Skip to content

Commit

Permalink
Issue #4936 - Fail LargeHeaderTest if client detects issues.
Browse files Browse the repository at this point in the history
Signed-off-by: Joakim Erdfelt <[email protected]>
  • Loading branch information
joakime committed Jun 3, 2020
1 parent 9a5dd78 commit c9e3e0d
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public void teardown()
}

@Test
public void testLargeHeader() throws Exception
public void testLargeHeader() throws Throwable
{
final Logger CLIENTLOG = Log.getLogger(LargeHeaderTest.class).getLogger(".client");
ExecutorService executorService = Executors.newFixedThreadPool(8);
Expand All @@ -108,6 +108,8 @@ public void testLargeHeader() throws Exception
"Host: localhost:" + localPort + "\r\n" +
"\r\n";

Throwable issues = new Throwable();

for (int i = 0; i < 500; ++i)
{
executorService.submit(() ->
Expand All @@ -120,18 +122,21 @@ public void testLargeHeader() throws Exception
output.flush();

String rawResponse = IO.toString(input, UTF_8);

CLIENTLOG.info("rawResponse[{}]=[{}]", rawResponse.length(), rawResponse);
HttpTester.Response response = HttpTester.parseResponse(rawResponse);
assertThat(response.getStatus(), is(500));
}
catch (Throwable t)
{
CLIENTLOG.warn("Client Issue", t);
issues.addSuppressed(t);
}
});
}

executorService.awaitTermination(5, TimeUnit.SECONDS);
if (issues.getSuppressed().length > 0)
{
throw issues;
}
}
}

0 comments on commit c9e3e0d

Please sign in to comment.