This is an automated email from the ASF dual-hosted git repository.
markt pushed a commit to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/8.5.x by this push:
new c60cf86282 Improve performance of HTTP/2 tests
c60cf86282 is described below
commit c60cf862827033426583d67e34ece11e0b621a6b
Author: Mark Thomas <[email protected]>
AuthorDate: Tue Dec 5 12:16:18 2023 +0000
Improve performance of HTTP/2 tests
---
test/org/apache/coyote/http2/Http2TestBase.java | 3 ++-
test/org/apache/coyote/http2/TestHttp2Section_4_2.java | 4 ++++
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/test/org/apache/coyote/http2/Http2TestBase.java
b/test/org/apache/coyote/http2/Http2TestBase.java
index 8daaa07294..e25130c1c3 100644
--- a/test/org/apache/coyote/http2/Http2TestBase.java
+++ b/test/org/apache/coyote/http2/Http2TestBase.java
@@ -16,6 +16,7 @@
*/
package org.apache.coyote.http2;
+import java.io.BufferedOutputStream;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
@@ -622,7 +623,7 @@ public abstract class Http2TestBase extends TomcatBaseTest {
s = socketFactory.createSocket("localhost", getPort());
s.setSoTimeout(30000);
- os = s.getOutputStream();
+ os = new BufferedOutputStream(s.getOutputStream());
InputStream is = s.getInputStream();
input = new TestInput(is);
diff --git a/test/org/apache/coyote/http2/TestHttp2Section_4_2.java
b/test/org/apache/coyote/http2/TestHttp2Section_4_2.java
index 3c158c724d..d73a2495a7 100644
--- a/test/org/apache/coyote/http2/TestHttp2Section_4_2.java
+++ b/test/org/apache/coyote/http2/TestHttp2Section_4_2.java
@@ -51,6 +51,7 @@ public class TestHttp2Section_4_2 extends Http2TestBase {
}
os.write(settings);
+ os.flush();
handleGoAwayResponse(1, Http2Error.FRAME_SIZE_ERROR);
}
@@ -73,6 +74,7 @@ public class TestHttp2Section_4_2 extends Http2TestBase {
// Empty payload
os.write(ping);
+ os.flush();
handleGoAwayResponse(1, Http2Error.FRAME_SIZE_ERROR);
}
@@ -95,6 +97,7 @@ public class TestHttp2Section_4_2 extends Http2TestBase {
// Empty payload
os.write(ping);
+ os.flush();
handleGoAwayResponse(1, Http2Error.FRAME_SIZE_ERROR);
}
@@ -118,6 +121,7 @@ public class TestHttp2Section_4_2 extends Http2TestBase {
// Empty payload
os.write(priority);
+ os.flush();
// Read Stream reset frame
parser.readFrame();
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]