Repository navigation
test(repro): Windows reproducer for the npm pack hang (#1130) - #1148
Merged
Merged
Conversation
Temporary diagnostic: runs npm pack --ignore-scripts --json on the prepare.test.ts fixture hundreds of times on Windows Node 24, with an appendFileSync trace preloaded into each npm child, to see whether npm stalls before process.exit, inside it, or exits while its pipes stay open. Refs #1130 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QeDRi91XaadWk1KdAbzvcB
The first Windows round (1,600 npm packs with the #1135 spawn, some under CPU load) never stalled: worst run 2.8 s. This round reproduces the spawn the test used when it failed (default stdio with a stdin pipe, no quiet npm settings) 4,000 times, and runs the failing shard 3/3 at the commit before #1135 fifteen times. Refs #1130 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QeDRi91XaadWk1KdAbzvcB
…ducer (#1130) Two Windows rounds found no stall: 5,600 npm pack runs on Node 24.21.0 with npm 11.19.0, under the current spawn, the pre-#1135 spawn and CPU load, all exited 0 well inside the timeout. The temporary pull_request workflow is removed; scripts/repro/README.md records the reproducer, what a null spawnSync status proves (npm itself had not exited), and the results. Refs #1130 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QeDRi91XaadWk1KdAbzvcB
jimhoyd
marked this pull request as ready for review
October 7, 2026 20:28
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.
Requested by Jimmy · project thread
Problem and change
Before: #1130 (
npm pack --ignore-scripts --jsonintest/prepare.test.tswrote its JSON on Windows Node 24, then hit the 30 s timeout) had no way to be reproduced on demand, and its cause was unknown.After:
scripts/repro/npm-pack-hang.tsreproduces that pack on the same fixture as many times as you ask, with an optional CPU load, using today's spawn (sync), the pre-#1135 spawn (legacy) or an async spawn that separates the child's exit from its pipes closing. A preloadednpm-trace.mjsrecords every stdout and stderr write and callback, theprocess.exitcall and theexitevent. A stalled run prints that trace, npm's debug log and the Windows process tree.What it found: across 5,600 runs on
windows-latest(Node 24.21.0, npm 11.19.0), none stalled or failed, whether they used the current spawn, the old one or ran under load. Node'sspawn_sync.ccsignals the child only if it has not already exited. The originalstatus: nulltherefore means npm itself was still running at 30 s, and a grandchild holding the pipes is ruled out. The root cause is still unconfirmed. #1135's diagnostics remain in place, so a recurrence will report the signal, the elapsed time and both streams. The test, its assertions and its timeout are unchanged.How: two temporary Windows workflow rounds ran the reproducer. That workflow has been removed, and
scripts/repro/README.mddocuments the script and these results.Verification
npm run lint,npm run typecheck,npm run typecheck:toolingandnpm run check:docspass locally.test/workflows.test.tsandtest/ci-workflow.test.tspass with the temporary workflow removed.Compatibility and security
Diagnostic scripts only. They are not run by
npm testand are not part of the published archive. No runtime, YAML or API change.Refs #1130
🤖 Generated with Claude Code
https://claude.ai/code/session_01QeDRi91XaadWk1KdAbzvcB