test: await expectMaxObjectTypeCount in the named-pipe leak check#32093
test: await expectMaxObjectTypeCount in the named-pipe leak check#32093robobun wants to merge 2 commits into
Conversation
The call in 'should work with named pipes' was not awaited, so the assertion was vacuous for that test and the floating promise's eventual failure (Expected: <= 0, Received: 5) got attributed to whichever test happened to be running later on the Windows lanes. Also read the baseline from the TCPSocket count (it read TLSSocket, which is always 0 in this file) and allow a small straggler margin over the baseline, matching node-tls-namedpipes.test.ts: server.close() can resolve before the last accepted pipe socket's finalizer runs.
|
Updated 12:44 AM PT - Jun 11th, 2026
❌ @robobun, your commit 6ed3ec1 has 2 failures in
🧪 To try this PR locally: bunx bun-pr 32093That installs a local version of the PR into your bun-32093 --bun |
|
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)
WalkthroughThe PR updates the Windows named-pipes test in ChangesNamed-pipes test reliability fix
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
|
CI status: this PR only changes code inside an The only hard failures on both builds are on debian Linux lanes this diff cannot execute on:
Not pushing further retriggers; ready for review/merge. |
Fixes #32092
Problem
test/js/node/net/node-net.test.ts, inside the Windows-only testshould work with named pipes:expectMaxObjectTypeCountis async (it pollsheapStats()withBun.sleepbetween GC passes) but the call is not awaited, the only un-awaited call site in the repo. Two consequences:expectMaxObjectTypeCount ... Expected: <= 0, Received: 5despite never calling the helper.The baseline is also read from the wrong object type:
TLSSocket(always 0 in this file) instead ofTCPSocket, so the effective bound was "TCPSocket count settles to <= 0".Fix
objectTypeCounts.TCPSocket.awaitthe call so the assertion actually runs inside this test and cannot poison later ones.before + 10with a 5s poll window. In build 61865 the count was still 5 over baseline after more than a second of polling; the siblingnode-tls-namedpipes.test.tsdocuments the same behavior (server.close()can resolve before the last accepted pipe socket's finalizer runs) and allows a small absolute margin for it. A genuine leak on this path would leave hundreds of sockets behind (the test opens ~1400), which the now-live assertion will catch.Verification
The edited test is
it.if(isWindows), so Windows CI is the real signal. On Linux,bun bd test test/js/node/net/node-net.test.tsproduces identical results with and without this change (the named-pipe test is skipped; the 10 failures in my sandbox are pre-existing container-networking failures that reproduce on main).