Skip to content

Commit

Permalink
Merge eeb6202 into master
Browse files Browse the repository at this point in the history
  • Loading branch information
simonbasle committed Sep 6, 2019
2 parents e21f75f + eeb6202 commit 85eba2f
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1278,8 +1278,6 @@ public void scanSubscriber() {
Assertions.assertThat(test.scan(Scannable.Attr.PREFETCH)).isEqualTo(123);
test.requested = 35;
Assertions.assertThat(test.scan(Scannable.Attr.REQUESTED_FROM_DOWNSTREAM)).isEqualTo(35L);
test.queue.add(1);
Assertions.assertThat(test.scan(Scannable.Attr.BUFFERED)).isEqualTo(1);

Assertions.assertThat(test.scan(Scannable.Attr.TERMINATED)).isFalse();
test.onError(new IllegalStateException("boom"));
Expand All @@ -1289,6 +1287,12 @@ public void scanSubscriber() {
Assertions.assertThat(test.scan(Scannable.Attr.CANCELLED)).isFalse();
test.cancel();
Assertions.assertThat(test.scan(Scannable.Attr.CANCELLED)).isTrue();

//once cancelled, there shouldn't be any draining left
// => better place to test that BUFFERED reflects the size of the queue
test.queue.add(1);
test.queue.add(1);
Assertions.assertThat(test.scan(Scannable.Attr.BUFFERED)).isEqualTo(2);
}

@Test
Expand Down

0 comments on commit 85eba2f

Please sign in to comment.