Skip to content

Commit

Permalink
Fix flaky test in InputStreamStreamMessageTest (#5702)
Browse files Browse the repository at this point in the history
Close #5695
  • Loading branch information
kojilin committed May 27, 2024
1 parent 2414099 commit 1b28c8e
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ void emptyInputStream() {
StepVerifier.create(byteStreamMessage)
.verifyComplete();
assertThat(byteStreamMessage.isEmpty()).isTrue();
assertThat(byteStreamMessage.isOpen()).isFalse();
await().untilAsserted(() -> assertThat(byteStreamMessage.isOpen()).isFalse());
}

@Test
Expand All @@ -420,7 +420,7 @@ void closedInputStream() throws IOException {
assertThatThrownBy(() -> byteStreamMessage.subscribe().join())
.hasCauseInstanceOf(IOException.class);
assertThat(byteStreamMessage.isEmpty()).isTrue();
assertThat(byteStreamMessage.isOpen()).isFalse();
await().untilAsserted(() -> assertThat(byteStreamMessage.isOpen()).isFalse());
}

@Test
Expand All @@ -447,7 +447,7 @@ public int read() throws IOException {
.expectNext(HttpData.wrap(new byte[] { 4 }))
.verifyError(IOException.class);
assertThat(byteStreamMessage.isEmpty()).isFalse();
assertThat(byteStreamMessage.isOpen()).isFalse();
await().untilAsserted(() -> assertThat(byteStreamMessage.isOpen()).isFalse());
}

@Test
Expand All @@ -463,7 +463,7 @@ void aborted() {
.expectNext(HttpData.wrap(new byte[] { 1, 2, 3 }))
.then(byteStreamMessage::abort)
.verifyError(AbortedStreamException.class);
assertThat(byteStreamMessage.isOpen()).isFalse();
await().untilAsserted(() -> assertThat(byteStreamMessage.isOpen()).isFalse());
}

@Test
Expand Down

0 comments on commit 1b28c8e

Please sign in to comment.