Repository navigation
test(hosts): retry the update-worker temp cleanup a Windows child still holds - #381
Conversation
…ll holds The after() hook only signals its children; on Windows one can still hold a handle in the temp dir, so rmSync failed EBUSY as an unhandled error between tests (seen on several branches).
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Code Review Roast 🔥Verdict: No Issues Found | Recommendation: Merge Oh wait, this PR is actually clean. I need to sit down. I had my flamethrower warmed up and everything. 📊 Overall: Like finding a unicorn in production — I didn't think clean PRs existed anymore, but here we are. Files Reviewed (1 file)
Reviewed by free · Input: 41.7K · Output: 1.1K · Cached: 75.7K |
…ore removing their temp dir (#383) On Windows the update-worker test's after() hook failed with EBUSY on rm 'host-update-worker-XXXX' even with the maxRetries added in #381. Two causes, both in teardown: - Bun's fs.rmSync ignores maxRetries/retryDelay (verified: a bind-mounted dir fails with EBUSY after 0 ms under bun, after the full backoff under node), so the retries never ran. - after() only signalled processes and went straight to rmSync. A killed Windows process keeps its cwd and handles until it is gone, and the detached daemons the worker launches (cwd inside `base`) were known only by the pid in health.json, which candidates that never acknowledged do not write. Now each fake host appends its pid to a pidfile on its first line (the fake manager's web already had one), after() signals every recorded pid plus the stand-ins and waits (10 s) until each is gone, then removes `base` with its own retry loop. The descriptor's daemon cwd is the OS tmp dir instead of a directory inside `base`, since no test depends on it.
lib/hosts/update-worker.test.mjs'safter()only signals its child processes, then removes the temp dir at once. On Windows a child can still hold a handle there, sormSyncthrowsEBUSYand bun reports "1 error" (an unhandled error between tests) with every test passing. It failed Verify (windows-latest) on #380 twice (run 41597241583, attempts 1 and 2) and onfeat/dual-mode-session-fork(run 41578056750). The cleanup now retries (maxRetries: 20, retryDelay: 100).Summary by CodeRabbit