test: harden http2-request-never-settles against late session errors - #5674
Open
pacocartones wants to merge 1 commit into
Open
test: harden http2-request-never-settles against late session errors#5674pacocartones wants to merge 1 commit into
pacocartones wants to merge 1 commit into
Conversation
The churn server is the only emitter in the setup without an 'error' handler; a late ECONNRESET (client aborts, GOAWAYs, destroyed sessions, agent.destroy()) after the test body resolves kills the process, and CI reports a bare 'test failed' with no TAP. Swallow them like test/http2-abort.js already does. Signed-off-by: pacocartones <manusanchezhl@gmail.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5674 +/- ##
=======================================
Coverage 93.43% 93.44%
=======================================
Files 110 110
Lines 38733 38776 +43
=======================================
+ Hits 36190 36234 +44
+ Misses 2543 2542 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
This relates to...
The flaky
test/http2-request-never-settles.js(added in #5603), currently failing intermittently onmainand painting unrelated PRs red. Update 2026-08-09: root cause identified upstream — this is nodejs/node#64841, a V8 Maglev SIGSEGV regression in Node ≥ v24.15.0, not an undici bug. This PR no longer claims to fix the red CI; see the verification section.Rationale
Since #5603 merged, this test fails intermittently in CI with a distinctive signature:
✖ test/http2-request-never-settles.js 'test failed'with no TAP output, no subtests, no stack, the file finishing in 3–9 s so the 15 s watchdog never runs. That signature is the test process dying abruptly, with the TAP stream discarded.The original hypothesis of this PR was a late unhandled
'error'on the churn server (the only emitter without a handler). That hypothesis has now been falsified as the cause of the red CI (see below): the killer is a native crash, not a JS exception. The handlers remain correct hygiene for a churn server — an unhandled'error'would kill the process (with a visible stack, unlike the flake) — but they do not cure the flake.Changes
Test-only (+9/−0), copying the established pattern from
test/http2-abort.js:server.on('error', …),session.on('error', …)andsession.socket?.on('error', …)(tracked per session), andserver.on('secureConnection', …)— late errors are swallowed instead of killing the process.No library code touched; the settle invariant under test is unchanged.
Verification
Red→green falsification: NEGATIVE — this hardening does not fix the flake. Reproduced locally on WSL2 (Ubuntu 24.04) using the exact recipe from nodejs/node#64841 (batches of 6 processes,
taskset -c 0,1), on undici86b62998:--no-maglevcorrupted size vs. prev_size) — not a clean stopgapThe crash log is byte-identical to the CI signature: a single TAP line (
✔ every h2 request settles under connection churn (seed 7)) and then sudden death — no error, no stack, exit 139. A probe test dying by an unhandled EventEmitter'error'does show its stack under the test runner, confirming the CI killer is a signal death (SIGSEGV in Maglev concurrent compilation), not a JS exception.What this means, honestly:
mainand on fix(env-http-proxy-agent): ignore trailing dots when matching no_proxy #5637/fix(deduplicate): settle the deduplicated request when it is aborted #5673/fix(retry): honor the abort signal during the retry backoff #5675 is Intermittent SIGSEGV in Maglev concurrent compilation on Linux (PersistentHandles::GetHandle) — regression between v24.14.1 and v24.15.0 node#64841. Updating Node in CI does not help today (24.19.0 is still affected);--no-maglevis not a clean workaround (residual native instability).Status