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.
This commit is contained in:
Simone Bordet 2017-01-16 12:13:05 +01:00
parent a684c028b5
commit ce4c48a877
1 changed files with 4 additions and 0 deletions

View File

@ -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;