Repository navigation
test: force mocha to exit so a leaked handle cannot hang CI - #124
Merged
Merged
Conversation
The Publish job on a91915a sat for 6 hours and was killed by GitHub's hard limit. The nodefs test clones wasm-git from github.com over the real network, and that transfer died at 68%: net 68% ( 247 kb, 476/699) / idx 40% (285/699) ERROR 12: could not read from remote repository The ErrnoError errno 44 mocha reported is the follow-on ENOENT from FS.chdir() into a clone directory that was never created. Mocha had already printed "13 passing, 1 failing" — but never exited, because the aborted clone leaves a live handle in the emscripten module and there is no .mocharc and no --exit, so the event loop never drains. --exit makes mocha terminate once the run is over, whatever handles third party code left behind. Verified with a probe that leaks a listening socket and throws: without --exit the process hangs until killed, with --exit it exits immediately with code 1, preserving the failure. This treats the symptom — the handle leak in the aborted clone, and the network dependency in the nodefs test itself, are still there — but it turns a runner occupied for six hours into an immediate visible failure. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
What happened
The Publish job on a91915a (run 32522680732) sat for 6 hours and was killed by GitHub's hard limit.
The trigger was a transient network failure, not a code problem.
test/nodefs.spec.jscloneswasm-gitfrom github.com over the real internet, and that transfer died at 68%:The
ErrnoError errno 44mocha reported is just the follow-on ENOENT fromFS.chdir()into a clone directory that was never created. The CI workflow on the same commit passed in 6m27s, running the same node suite — so this was a flake, not a regression.The damage came afterwards: mocha printed
13 passing, 1 failingand then never exited. The aborted clone leaves a live handle in the emscripten module, and with no.mocharcand no--exitthe event loop never drains. The job held a runner until the 6-hour cap, ending inTerminate orphan process: pid (12095) (npm run test).The change
--exiton the two mocha scripts, so the process terminates once the run is over regardless of what handles third-party code left behind.Verification
A probe that leaks a listening socket and throws, run under a 10-second cap:
mochamocha --exitBoth node suites still pass:
npm test(14) andnpm run test-opfs-detect(8).Scope
This treats the symptom. The handle leak in the aborted clone, and the fact that
nodefs.spec.jsdepends on reaching github.com at all, are both still there — worth a retry wrapper or a local fixture if that test keeps flaking. What this buys is that a hang becomes an immediate visible failure instead of an occupied runner.Complements #122, which caps every job at
timeout-minutes: 30.🤖 Generated with Claude Code