From ce4c48a87707c61ff366fa417ce4b63b47777531 Mon Sep 17 00:00:00 2001 From: Simone Bordet Date: Mon, 16 Jan 2017 12:13:05 +0100 Subject: [PATCH] Fixes #1261 - Intermittent H2C test failure AsyncIOServletTest.testAsyncReadEarlyEOF. Delayed abrupt output shutdown in case of HTTP/2, to allow to reply to SETTINGS frames exchanged during the preface. --- .../org/eclipse/jetty/http/client/AsyncIOServletTest.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/test-http-client-transport/src/test/java/org/eclipse/jetty/http/client/AsyncIOServletTest.java b/tests/test-http-client-transport/src/test/java/org/eclipse/jetty/http/client/AsyncIOServletTest.java index 61f38956422..ebe9980ef59 100644 --- a/tests/test-http-client-transport/src/test/java/org/eclipse/jetty/http/client/AsyncIOServletTest.java +++ b/tests/test-http-client-transport/src/test/java/org/eclipse/jetty/http/client/AsyncIOServletTest.java @@ -1024,6 +1024,10 @@ public class AsyncIOServletTest extends AbstractTest break; case H2C: case H2: + // In case of HTTP/2, we not only send the request, but also the preface and + // SETTINGS frames. SETTINGS frame need to be replied, so we want to wait to + // write the reply before shutting output down, so that the test does not fail. + Thread.sleep(1000); Session session = ((HttpConnectionOverHTTP2)connection).getSession(); ((HTTP2Session)session).getEndPoint().shutdownOutput(); break;