Keep the NetClient referenced in tests that rely on the connection staying open - #6317
Open
jnbdz wants to merge 1 commit into
Open
Keep the NetClient referenced in tests that rely on the connection staying open#6317jnbdz wants to merge 1 commit into
jnbdz wants to merge 1 commit into
Conversation
…aying open Motivation: Http2Test#testSslHandshakeTimeout is listed in eclipse-vertx#6218 as failing in 4 out of 60 CI runs with an unsatisfied checkpoint. The test connects with an unreferenced NetClient and returns, then waits for the server to report the handshake timeout. A client that is no longer referenced is closed when it is garbage collected, so under memory pressure the connection is closed before the handshake timeout happens and the server never reports it. Forcing a garbage collection after the connect reproduces the CI failure every time. HttpConnectionEarlyResetTest#testExceptionCaught has the same pattern: it expects a connection reset two seconds after connecting, a client closed by the garbage collector closes the connection gracefully instead. Changes: Keep the NetClient in a field in both tests so that it stays referenced for the duration of the test.
This was referenced Aug 15, 2026
Member
|
Please rebase and run |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Http2Test#testSslHandshakeTimeoutis listed in #6218 as failing in 4 out of 60 CI runs withTimeout Unsatisfied checkpoint.The test opens a connection with
vertx.createNetClient().connect(...).await(), keeps neither the client nor the socket referenced and returns, then the checkpoint waits for the server to reporthandshake timed out after 1234ms. Since a client that is no longer referenced is closed when it is garbage collected, under memory pressure the connection is closed before the handshake timeout happens: the server sees a plain close, never reports theSSLHandshakeException, and the checkpoint is never satisfied. Adding aSystem.gc()loop after the connect reproduces the CI failure deterministically:HttpConnectionEarlyResetTest#testExceptionCaughthas the same pattern: it expects a connection reset (SO_LINGER=0) two seconds after connecting, but a client closed by the garbage collector closes the connection gracefully instead and the latch never counts down.Changes
Keep the
NetClientin a field in both tests so it stays referenced for the duration of the test (test-only change).Http2Test#testSslHandshakeTimeoutpasses with the forced garbage collection in place once the client is referenced.Related to #6218.