This is an automated email from the ASF dual-hosted git repository. remm pushed a commit to branch 8.5.x in repository https://gitbox.apache.org/repos/asf/tomcat.git
commit 62de8ffbc779b02da88cd598a8367593092e283e Author: remm <r...@apache.org> AuthorDate: Wed Mar 4 14:31:05 2020 +0100 Use a BAOS Attempt to make the test avoid frame buffering. Remove HTTP header output. --- test/org/apache/coyote/http2/Http2TestBase.java | 3 --- test/org/apache/coyote/http2/TestLargeUpload.java | 11 ++++++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/test/org/apache/coyote/http2/Http2TestBase.java b/test/org/apache/coyote/http2/Http2TestBase.java index b3e10b1..1a1ae9d 100644 --- a/test/org/apache/coyote/http2/Http2TestBase.java +++ b/test/org/apache/coyote/http2/Http2TestBase.java @@ -638,9 +638,6 @@ public abstract class Http2TestBase extends TomcatBaseTest { boolean readHttpUpgradeResponse() throws IOException { String[] responseHeaders = readHttpResponseHeaders(); - for (String header : responseHeaders) { - System.out.println("HEADER: " + header); - } if (responseHeaders.length < 3) { return false; diff --git a/test/org/apache/coyote/http2/TestLargeUpload.java b/test/org/apache/coyote/http2/TestLargeUpload.java index 1e657af..ce366ce 100644 --- a/test/org/apache/coyote/http2/TestLargeUpload.java +++ b/test/org/apache/coyote/http2/TestLargeUpload.java @@ -16,6 +16,7 @@ */ package org.apache.coyote.http2; +import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; import java.nio.ByteBuffer; @@ -44,8 +45,8 @@ public class TestLargeUpload extends Http2TestBase { ((AbstractHttp11Protocol<?>) http2Protocol.getHttp11Protocol()).setAllowedTrailerHeaders(TRAILER_HEADER_NAME); - int bodySize = 16384; - int bodyCount = 20; + int bodySize = 15000; + int bodyCount = 100; byte[] headersFrameHeader = new byte[9]; ByteBuffer headersPayload = ByteBuffer.allocate(128); @@ -60,9 +61,13 @@ public class TestLargeUpload extends Http2TestBase { // Write the headers writeFrame(headersFrameHeader, headersPayload); // Body + ByteArrayOutputStream baos = new ByteArrayOutputStream(); for (int i = 0; i < bodyCount; i++) { - writeFrame(dataFrameHeader, dataPayload); + baos.write(dataFrameHeader); + baos.write(dataPayload.array(), dataPayload.arrayOffset(), dataPayload.limit()); } + os.write(baos.toByteArray()); + os.flush(); // Trailers writeFrame(trailerFrameHeader, trailerPayload); --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org