Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix flaky vertx http2NoConnectionLeak test by using h2c prior knowledge
Signed-off-by: Marvin Froeder <[email protected]>
  • Loading branch information
velo committed Jun 3, 2026
commit 6769d9ad4ae3f6a00ebde2932b7b938619e7ee51
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,14 @@ void http2NoConnectionLeak(Vertx vertx, VertxTestContext testContext) {
int poolSize = 1;
int nbRequests = 100;

WebClientOptions options = new WebClientOptions().setProtocolVersion(HttpVersion.HTTP_2);
// Use h2c with prior knowledge instead of the default HTTP/1.1 upgrade: during the upgrade
// handshake the connection is still HTTP/1.1, so the pool applies http1MaxSize (5) rather than
// http2MaxSize (1) and can open several connections under load before the first upgrades to
// HTTP/2 - which made this test flaky on CI.
WebClientOptions options =
new WebClientOptions()
.setProtocolVersion(HttpVersion.HTTP_2)
.setHttp2ClearTextUpgrade(false);
PoolOptions poolOptions = new PoolOptions().setHttp2MaxSize(1);
WebClient webClient = WebClient.create(vertx, options, poolOptions);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,15 @@ void http2NoConnectionLeak(Vertx vertx, VertxTestContext testContext) {
int poolSize = 1;
int nbRequests = 100;

// Use h2c with prior knowledge instead of the default HTTP/1.1 upgrade: during the upgrade
// handshake the connection is still HTTP/1.1, so the pool applies the HTTP/1.1 max pool size
// rather than the HTTP/2 one and can open several connections under load before the first
// upgrades to HTTP/2 - which made this test flaky on CI.
WebClientOptions options =
new WebClientOptions().setProtocolVersion(HttpVersion.HTTP_2).setHttp2MaxPoolSize(1);
new WebClientOptions()
.setProtocolVersion(HttpVersion.HTTP_2)
.setHttp2MaxPoolSize(1)
.setHttp2ClearTextUpgrade(false);
WebClient webClient = WebClient.create(vertx, options);

HelloServiceAPI client =
Expand Down