8174833: java/net/httpclient/http2/BasicTest.java always fails but always report success

Reviewed-by: michaelm
This commit is contained in:
Daniel Fuchs 2017-02-13 17:18:48 +00:00
parent 9d5439dda1
commit 28fc67ce7e
2 changed files with 5 additions and 2 deletions

View File

@ -94,6 +94,7 @@ public class BasicTest {
} catch (Throwable tt) {
System.err.println("tt caught");
tt.printStackTrace();
throw tt;
} finally {
httpServer.stop();
httpsServer.stop();
@ -223,7 +224,7 @@ public class BasicTest {
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()))

View File

@ -392,9 +392,11 @@ public class Http2TestServerConnection {
//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;