diff --git a/jetty-websocket/websocket-common/src/test/java/org/eclipse/jetty/websocket/common/test/BlockheadClientRequest.java b/jetty-websocket/websocket-common/src/test/java/org/eclipse/jetty/websocket/common/test/BlockheadClientRequest.java index 8dd9b2801f9..ccd8a209412 100644 --- a/jetty-websocket/websocket-common/src/test/java/org/eclipse/jetty/websocket/common/test/BlockheadClientRequest.java +++ b/jetty-websocket/websocket-common/src/test/java/org/eclipse/jetty/websocket/common/test/BlockheadClientRequest.java @@ -225,6 +225,8 @@ public class BlockheadClientRequest extends HttpRequest implements Response.Comp endp, client.getExecutor()); + endp.setIdleTimeout(client.getIdleTimeout()); + connection.setUpgradeResponseHeaders(response.getHeaders()); // Now swap out the connection diff --git a/jetty-websocket/websocket-common/src/test/java/org/eclipse/jetty/websocket/common/test/BlockheadConnection.java b/jetty-websocket/websocket-common/src/test/java/org/eclipse/jetty/websocket/common/test/BlockheadConnection.java index 2269e7f3f14..a8374e323b8 100644 --- a/jetty-websocket/websocket-common/src/test/java/org/eclipse/jetty/websocket/common/test/BlockheadConnection.java +++ b/jetty-websocket/websocket-common/src/test/java/org/eclipse/jetty/websocket/common/test/BlockheadConnection.java @@ -194,7 +194,7 @@ public class BlockheadConnection extends AbstractConnection implements Connectio { int len = Math.min(numBytes, buf.remaining()); ByteBuffer slice = buf.slice(); - buf.position(len); + buf.limit(len); try { getEndPoint().flush(slice); diff --git a/jetty-websocket/websocket-common/src/test/java/org/eclipse/jetty/websocket/common/test/Fuzzer.java b/jetty-websocket/websocket-common/src/test/java/org/eclipse/jetty/websocket/common/test/Fuzzer.java index 26910fcf0e4..d83ddabe863 100644 --- a/jetty-websocket/websocket-common/src/test/java/org/eclipse/jetty/websocket/common/test/Fuzzer.java +++ b/jetty-websocket/websocket-common/src/test/java/org/eclipse/jetty/websocket/common/test/Fuzzer.java @@ -84,6 +84,8 @@ public class Fuzzer implements AutoCloseable client.setIdleTimeout(TimeUnit.SECONDS.toMillis(2)); + client.start(); + this.generator = testcase.getLaxGenerator(); this.testname = testcase.getTestMethodName(); } @@ -111,6 +113,14 @@ public class Fuzzer implements AutoCloseable public void close() { this.clientConnection.close(); + try + { + this.client.stop(); + } + catch (Exception ignore) + { + LOG.ignore(ignore); + } } public void disconnect() @@ -121,6 +131,7 @@ public class Fuzzer implements AutoCloseable public void connect() throws IOException { BlockheadClientRequest request = this.client.newWsRequest(testcase.getServerURI()); + request.idleTimeout(2, TimeUnit.SECONDS); request.header("X-TestCase", testname); Future connFut = request.sendAsync();