Skip to content

test: cleanup of planted node copies retries a Windows EBUSY - #68

Merged
llima merged 2 commits into
mainfrom
fix/local-bin-ebusy
Oct 18, 2026
Merged

llima merged 2 commits into
mainfrom
fix/local-bin-ebusy

Conversation

@llima

@llima llima commented Oct 18, 2026

Copy link
Copy Markdown
Owner

Summary

  • CI on main (windows-latest · node 22) failed in test/local-bin.test.ts's afterAll: EBUSY unlinking the planted copy of node (craftar-fake-bin-tool.exe), with every test passing. Windows can keep a just-run executable locked for a moment.
  • New test/helpers/fs.ts › removeWithRetry: fs.rm with recursive, force, maxRetries: 6, retryDelay: 200. Node's backoff is linear, so one call waits at most 4.2 s, which keeps both calls of a hook inside vitest's 10 s hookTimeout. An error that lasts past the retries still fails the file.
  • Used by every cleanup of a planted node copy: both removals in local-bin.test.ts's afterAll, its elsewhere cleanup, and proc.test.ts's afterAll. No assertion changes.
  • Test-only. No version change, as in test: a 60 s per-test limit on Windows, and the three tests that timed out split #61: nothing is published.

Test plan

  • npm run typecheck and npm run build exit 0.
  • npx vitest run test/local-bin.test.ts test/proc.test.ts --maxWorkers=6 on Linux: 38 passed, 2 skipped.
  • Full suite on Linux (--exclude test/ci.test.ts --maxWorkers=6): 3087 passed, 8 skipped. test/ci.test.ts was not run by hand.
  • Oracle skipped: no fixture on this machine, and the change is test-only (no emitted bytes).
  • Windows CI is the proof. The EBUSY could not be reproduced on Linux, so this PR's windows-latest jobs, and later runs on main, are what show the fix holds.

llima added 2 commits October 18, 2026 16:04
…t-run copy of node (EBUSY)

CI failed in the file's afterAll hook: EBUSY on the temp .exe.
Nothing the tests assert changes.
…roc.test.ts's planted node too (review)

vitest's 10 s hookTimeout bounds the budget: 6 × 200 ms is 4.2 s, inside twice.
proc.test.ts's afterAll had the same exposure.
@llima
llima merged commit 87b6d82 into main Oct 18, 2026
8 checks passed
@llima
llima deleted the fix/local-bin-ebusy branch October 18, 2026 22:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant