From e99f28bc17dc11f91182c5936e8e8b5f27ab1a4f Mon Sep 17 00:00:00 2001 From: Greg Wilkins Date: Tue, 6 Mar 2018 14:29:53 +1100 Subject: [PATCH] more robust test by avoiding SSL close race Signed-off-by: Greg Wilkins --- .../org/eclipse/jetty/server/ThreadStarvationTest.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/ThreadStarvationTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/ThreadStarvationTest.java index 73dee6fbbbf..4d3c90cce11 100644 --- a/jetty-server/src/test/java/org/eclipse/jetty/server/ThreadStarvationTest.java +++ b/jetty-server/src/test/java/org/eclipse/jetty/server/ThreadStarvationTest.java @@ -298,7 +298,8 @@ public class ThreadStarvationTest List> clientTasks = new ArrayList<>(); - for(int i=0; i { try (Socket client = clientSocketProvider.newSocket("localhost", _connector.getLocalPort()); @@ -346,7 +347,8 @@ public class ThreadStarvationTest Long bodyCount = responseFut.get(); assertThat(bodyCount.longValue(), is(expected)); } - } finally + } + finally { clientExecutors.shutdownNow(); } @@ -366,6 +368,7 @@ public class ThreadStarvationTest baseRequest.setHandled(true); response.setStatus(200); + response.setContentLength(BUFFERS*BUFFER_SIZE); OutputStream out = response.getOutputStream(); for (int i=0;i