changeset 16720:4fc407cc1bad

8174833: java/net/httpclient/http2/BasicTest.java always fails but always report success Reviewed-by: michaelm
author dfuchs
date Mon, 13 Feb 2017 17:18:48 +0000
parents fdfa7b2fe9a7
children a3b3c7b6464d
files test/java/net/httpclient/http2/BasicTest.java test/java/net/httpclient/http2/server/Http2TestServerConnection.java
diffstat 2 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/test/java/net/httpclient/http2/BasicTest.java	Mon Feb 13 11:35:00 2017 -0500
+++ b/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/test/java/net/httpclient/http2/server/Http2TestServerConnection.java	Mon Feb 13 11:35:00 2017 -0500
+++ b/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;