Skip to content

Commit a33a8f6

Browse files
committed
Configure initial settings for Http2ClientTimeout tests instead of configuring the connection initially as it can be racy
1 parent 2349b9a commit a33a8f6

File tree

2 files changed

+3
-11
lines changed

2 files changed

+3
-11
lines changed

src/test/java/io/vertx/core/http/Http2ClientTimeoutTest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ public class Http2ClientTimeoutTest extends HttpClientTimeoutTest {
1414

1515
@Override
1616
protected HttpServerOptions createBaseServerOptions() {
17-
return Http2ServerTest.createHttp2ServerOptions(HttpTestBase.DEFAULT_HTTPS_PORT, HttpTestBase.DEFAULT_HTTPS_HOST);
17+
return Http2ServerTest
18+
.createHttp2ServerOptions(HttpTestBase.DEFAULT_HTTPS_PORT, HttpTestBase.DEFAULT_HTTPS_HOST)
19+
.setInitialSettings(new Http2Settings().setMaxConcurrentStreams(5));
1820
}
1921

2022
@Override

src/test/java/io/vertx/core/http/HttpClientTimeoutTest.java

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,6 @@ public void testConnectTimeoutDoesFire() throws Exception {
3737
server.requestHandler(req -> {
3838
req.response().end();
3939
});
40-
server.connectionHandler(conn -> {
41-
if (conn.getWindowSize() != -1) {
42-
conn.updateSettings(new Http2Settings().setMaxConcurrentStreams(5));
43-
}
44-
});
4540
startServer(testAddress);
4641
List<HttpClientRequest> requests = new ArrayList<>();
4742
for (int i = 0;i < 5;i++) {
@@ -64,11 +59,6 @@ public void testConnectTimeoutDoesNotFire() throws Exception {
6459
server.requestHandler(req -> {
6560
req.response().end();
6661
});
67-
server.connectionHandler(conn -> {
68-
if (conn.getWindowSize() != -1) {
69-
conn.updateSettings(new Http2Settings().setMaxConcurrentStreams(5));
70-
}
71-
});
7262
startServer(testAddress);
7363
List<HttpClientRequest> requests = new ArrayList<>();
7464
for (int i = 0;i < 5;i++) {

0 commit comments

Comments
 (0)