8174833: java/net/httpclient/http2/BasicTest.java always fails but always report success
authordfuchs
Mon, 13 Feb 2017 17:18:48 +0000
changeset 43788 22a618ec8268
parent 43735 83505546dec3
child 43789 43068ea5965e
8174833: java/net/httpclient/http2/BasicTest.java always fails but always report success Reviewed-by: michaelm
jdk/test/java/net/httpclient/http2/BasicTest.java
jdk/test/java/net/httpclient/http2/server/Http2TestServerConnection.java
--- a/jdk/test/java/net/httpclient/http2/BasicTest.java	Mon Feb 13 11:35:00 2017 -0500
+++ b/jdk/test/java/net/httpclient/http2/BasicTest.java	Mon Feb 13 17:18:48 2017 +0000
@@ -94,6 +94,7 @@
         } catch (Throwable tt) {
             System.err.println("tt caught");
             tt.printStackTrace();
+            throw tt;
         } finally {
             httpServer.stop();
             httpsServer.stop();
@@ -223,7 +224,7 @@
         CompletableFuture[] responses = new CompletableFuture[LOOPS];
         final Path source = TestUtil.getAFile(FILESIZE);
         HttpRequest request = HttpRequest.newBuilder(uri)
-                                         .POST(fromFile(tempFile()))
+                                         .POST(fromFile(source))
                                          .build();
         for (int i = 0; i < LOOPS; i++) {
             responses[i] = client.sendAsync(request, asFile(tempFile()))
--- a/jdk/test/java/net/httpclient/http2/server/Http2TestServerConnection.java	Mon Feb 13 11:35:00 2017 -0500
+++ b/jdk/test/java/net/httpclient/http2/server/Http2TestServerConnection.java	Mon Feb 13 17:18:48 2017 +0000
@@ -392,9 +392,11 @@
         //System.err.println ("Stream window size = " + winsize);
 
         final InputStream bis;
-        if (endStreamReceived) {
+        if (endStreamReceived && queue.size() == 0) {
+            System.err.println("Server: got END_STREAM for stream " + streamid);
             bis = NullInputStream.INSTANCE;
         } else {
+            System.err.println("Server: creating input stream for stream " + streamid);
             bis = new BodyInputStream(queue, streamid, this);
         }
         try (bis;