Conversation
test/js/node/test/parallel/test-net-connect-memleak.js fails on ~half of PR builds on the alpine 3.23 x64 and x64-baseline lanes. It asserts a FinalizationRegistry cleanup callback fires within a single globalThis.gc() plus one setImmediate after the connect callback's closure is unreferenced. The spec gives no timing guarantee for cleanup callbacks and JSC schedules them via DeferredWorkTimer with no defined ordering relative to the immediate queue, so on musl x64 delivery sometimes slips past that single setImmediate. Its tls twin (test-tls-connect-memleak.js) has the identical onGC + gc() + setImmediate pattern and was already quarantined on this exact matrix. Both are verbatim upstream node ports we do not edit, so mark the net twin FLAKY next to the tls one. It still runs on glibc Linux, darwin, and Windows.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
Walkthrough
Flaky test expectation update
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
Comment |
|
Updated 3:25 AM PT - Jun 29th, 2026
❌ @robobun, your commit 3e810cf has 1 failures in
🧪 To try this PR locally: bunx bun-pr 33045That installs a local version of the PR into your bun-33045 --bun |
There was a problem hiding this comment.
LGTM — test-infra only, adds the net twin next to its already-quarantined tls sibling on the same musl-x64 modifier.
Extended reasoning...
Overview
This PR touches a single file, test/expectations.txt, adding one [ FLAKY ] quarantine line for test/js/node/test/parallel/test-net-connect-memleak.js scoped to [ LINUX-X64-MUSL ], and rewording the existing comment block to cover both the tls and net variants together. The tls sibling was already quarantined on this exact modifier with the same rationale (FinalizationRegistry callback delivery vs setImmediate timing under JSC on musl x64). No source code or test code is changed.
Security risks
None. This is a CI test-expectations metadata file consumed only by scripts/runner.node.mjs to decide which test outcomes are tolerated on which lanes. It has no bearing on the shipped binary, auth, crypto, or any runtime path.
Level of scrutiny
Low. The change is mechanical and follows an established pattern already present one line above for the tls twin. I confirmed the LINUX-X64-MUSL modifier is produced by the runner's getTestModifiers (${os}-${arch}-${abi} uppercased), so the scoping is correct and matches the existing entry. The quarantined test file exists in the repo. The [ FLAKY ] expectation means the test still runs and only tolerates intermittent failure on the two Alpine x64 lanes; all other platforms continue to gate on it.
Other factors
The bug-hunting system found no issues. There are no outstanding human reviewer comments. The PR description provides build links demonstrating the flake on unrelated PRs and explains why an in-test fix isn't available (verbatim upstream Node port policy). This is well within the bounds of a routine flaky-test quarantine.
There was a problem hiding this comment.
No issues found — this mirrors the existing test-tls-connect-memleak.js quarantine line exactly (same [ LINUX-X64-MUSL ] modifier, same [ FLAKY ] expectation). Deferring since test/expectations.txt has a CODEOWNER.
Extended reasoning...
Overview
This PR adds a single [ FLAKY ] quarantine entry to test/expectations.txt for test/js/node/test/parallel/test-net-connect-memleak.js on the [ LINUX-X64-MUSL ] matrix, and rewords the comment block above it to cover both the tls and net memleak twins under one explanation. The new line is byte-for-byte the same shape as the pre-existing test-tls-connect-memleak.js entry directly above it. No source code is touched.
Security risks
None. This is a test-infrastructure-only change to a plain-text expectations file consumed by the CI runner. It does not affect the built binary, does not change runtime behavior, and does not touch auth/crypto/permissions.
Level of scrutiny
Low on the mechanics: the format, modifier, and expectation token all match an adjacent entry already accepted into the file, the target test file exists, and the rationale (FinalizationRegistry callback timing vs a single setImmediate on musl) is the same one already documented for the tls sibling. The only judgment call here is whether quarantining (vs. fixing) is the right policy, which is exactly what the CODEOWNER designation on this file exists to gate.
Other factors
.github/CODEOWNERS assigns /test/expectations.txt to a specific owner, so I'm deferring rather than approving. The bug-hunting pass found nothing; I verified the test path exists and that the new line follows the established pattern. The robobun CI comment shows unrelated failures on build #66669, which is expected for a quarantine-only change that doesn't fix other lanes.
Ready to merge: diff is green, only CI red is unrelated infraThis change adds a single The CI red on both #66669 and the re-run #66690 is the same pair of That is a BuildKite artifact-download timeout on the darwin aarch64 lane, not a test failure, and it has no relationship to a musl-x64 expectations entry. It reproduced identically across two independent builds, so another re-run is unlikely to clear it. Both automated reviews came back with no findings. |
|
The same failure is root-caused in #33225: it is conservative stack scanning keeping the removed listener's closure alive across the test's single |
Fixes #33044
What
test/js/node/test/parallel/test-net-connect-memleak.jsfails on roughly half of PR builds on the two musl test lanes (:alpine: 3.23 x64 - test-bunand:alpine: 3.23 x64-baseline - test-bun). The per-file retry also fails, so the lane goes red. The glibc linux x64 / x64-baseline / ASAN / darwin / Windows lanes do not hit it.Examples: build 66653, build 66657. These are unrelated PRs, so this is not caused by any one change.
Cause
The test registers an object in a
FinalizationRegistry(viacommon/gc.jsonGC), then asserts the cleanup callback has fired within oneglobalThis.gc()plus onesetImmediate. The FinalizationRegistry spec gives no timing guarantee for cleanup callbacks; JSC schedules them throughDeferredWorkTimerwith no defined ordering relative to the immediate queue. On musl x64 that delivery intermittently slips past the singlesetImmediate, socollectedis stillfalsewhen the assertion runs. The object is collected and the listener is removed; only the delivery timing is racy.This is the same mechanism already on record for the test's TLS sibling,
test-tls-connect-memleak.js, which was quarantined on this exact matrix (test/expectations.txt). Both tests use the identicalonGC+gc()+setImmediatepattern.Fix
These are verbatim upstream Node ports that we do not edit (
test/js/node/test/parallel/CLAUDE.md), so the robust in-test fix (gcUntil()instead of a single tick) is not available here. Mark thenettwin[ FLAKY ]on[ LINUX-X64-MUSL ]next to itstlssibling and fold both under one comment. TheLINUX-X64-MUSLmodifier covers both the regular and baseline musl x64 lanes; the test keeps running everywhere else.Verification
Parsing
test/expectations.txtwith the runner's own logic (scripts/runner.node.mjsgetTestExpectations) and simulating each lane's modifiers:test-tls-connect-memleak.jsandtest-net-connect-memleak.jsare quarantined.The failure is musl-x64 only and does not reproduce on glibc, so there is no local fail-before to capture off that platform; the change is test-infra only (no source change).