fix: resolve vitest hang caused by mkdirSync on /proc#26145
Conversation
The JS test suite hung indefinitely because safe_output_manifest.test.cjs
called writeTemporaryIdMapFile({}, "/proc/fake/map.json") which internally
runs fs.mkdirSync('/proc/fake', { recursive: true }). This hangs on Linux
because the procfs filesystem blocks the recursive mkdir call.
Changes:
- Replace /proc/fake/map.json with /dev/null/fake/map.json which fails
immediately (ENOTDIR) since /dev/null is a file, not a directory
- Remove forceExit: true from vitest.config.mjs (added by #26143 as a
workaround, but it masked the real issue rather than fixing it)
There was a problem hiding this comment.
Pull request overview
This PR resolves a Linux-specific vitest hang during test collection caused by attempting fs.mkdirSync(..., { recursive: true }) under /proc.
Changes:
- Updates
safe_output_manifest.test.cjsto use a non-directory path under/dev/nullso the failure is immediate (no hang). - Removes
forceExit: truefromvitest.config.mjssince it was masking the underlying issue and is no longer needed.
Show a summary per file
| File | Description |
|---|---|
| actions/setup/js/vitest.config.mjs | Removes forceExit from vitest config now that the hang cause is addressed. |
| actions/setup/js/safe_output_manifest.test.cjs | Replaces the /proc/... test path with /dev/null/... to fail fast instead of hanging on Linux. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 2/2 changed files
- Comments generated: 0
|
Prompt:
Result:
|
Problem
PR #26143 did not fix the vitest CI hang. The
jsjob was still hanging for 7+ minutes: https://github.com/github/gh-aw/actions/runs/24377417814/job/71193722349Root Cause
safe_output_manifest.test.cjshad a test that called:This internally runs
fs.mkdirSync('/proc/fake', { recursive: true })which hangs indefinitely on Linux because the procfs virtual filesystem blocks the recursive mkdir syscall. The vitest worker process would get stuck during test collection, causing the entire suite to freeze atsafe_output_manifest.test.cjs 0/35.The
forceExit: trueadded by #26143 was a Jest concept — vitest accepts it syntactically but it did not reliably force-kill the hung worker.Fix
/proc/fake/map.jsonwith/dev/null/fake/map.json— fails immediately withENOTDIRsince/dev/nullis a file, not a directoryforceExit: truefromvitest.config.mjs— it masked the issue rather than fixing it, and with the root cause resolved it's no longer neededValidation
safe_output_manifest.test.cjs: all 35 tests pass in ~280ms (previously hung indefinitely)