Skip to content

Commit

Permalink
[UNDERTOW-2323] Update the test for handling special case where clien…
Browse files Browse the repository at this point in the history
…t gets a connection closed by goaway before processing the responses from server

Signed-off-by: Flavia Rainone <[email protected]>
  • Loading branch information
fl4via committed Oct 17, 2023
1 parent 6f0ca47 commit 05d58fa
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,15 @@ public void assertDoSRstFramesHandled(int totalNumberOfRequests, int rstStreamLi

latch.await(200, TimeUnit.SECONDS);

Assert.assertEquals(errorExpected? rstStreamLimit + 1:totalNumberOfRequests, responses.size());
// server sent go away before processing and responding client frames, sometimes this happens, depends on the order of threads
// being executed
if (responses.isEmpty()) {
Assert.assertTrue(errorExpected);
Assert.assertNotNull(exception);
Assert.assertTrue(exception instanceof ClosedChannelException);
return;
}
Assert.assertEquals(errorExpected ? rstStreamLimit + 1 : totalNumberOfRequests, responses.size());
for (final ClientResponse response : responses) {
final String responseBody = response.getAttachment(RESPONSE_BODY);
Assert.assertTrue("Unexpected response body: " + responseBody, responseBody.isEmpty() || responseBody.equals(message));
Expand Down

0 comments on commit 05d58fa

Please sign in to comment.