diff --git a/jetty-http2/http2-client/src/test/java/org/eclipse/jetty/http2/client/AsyncIOTest.java b/jetty-http2/http2-client/src/test/java/org/eclipse/jetty/http2/client/AsyncIOTest.java index 1881a10a6d3e..c6d5bfcd9ba5 100644 --- a/jetty-http2/http2-client/src/test/java/org/eclipse/jetty/http2/client/AsyncIOTest.java +++ b/jetty-http2/http2-client/src/test/java/org/eclipse/jetty/http2/client/AsyncIOTest.java @@ -243,8 +243,8 @@ public void onWritePossible() throws IOException // The write is too large and will stall. output.write(ByteBuffer.wrap(new byte[2 * clientWindow])); - // We cannot call complete() now before checking for isReady(). - // This will abort the response and the client will receive a reset. + // We can now call complete() now before checking for isReady(). + // This will asynchronously complete when the write is finished. asyncContext.complete(); } @@ -275,10 +275,15 @@ public Map onPreface(Session session) session.newStream(frame, promise, new Stream.Listener.Adapter() { @Override - public void onReset(Stream stream, ResetFrame frame) + public void onClosed(Stream stream) { latch.countDown(); } + + @Override + public void onReset(Stream stream, ResetFrame frame) + { + } }); assertTrue(latch.await(5, TimeUnit.SECONDS)); }