Repository navigation
test(hosts): wait for every process the update-worker tests start before removing their temp dir - #383
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 19 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. CodeRabbit Verify
|
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 (4 files)
Previous Review Summary (commit 7196eef)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit 7196eef)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 (2 files)
Reviewed by free · Input: 28.6K · Output: 1.8K · Cached: 166K |
…ore removing their temp dir 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.
|
Rebased onto main after #379, which fixed the same EBUSY a narrower way (waits for children and hosts that wrote |
7196eef to
e8f1fc7
Compare
Follow-up to #381, which did not fix the Windows
EBUSYinlib/hosts/update-worker.test.mjs'safter()(main failed the same way on 88ee1c5).Why #381 did nothing: under Bun,
rmSync'smaxRetries/retryDelayare ignored. Reproduced on a busy mount: Node retried for ~4 s, Bun threwEBUSYafter 0 ms. CI runsbun test.What held the directory:
after()only signalled processes and removedbaseat once. Worse, daemons the worker launches (detached, unref'd) ran with their cwd insidebaseand were tracked only throughhealth.json, which a candidate that never acknowledges, or a rollback, never leaves behind.Change (tests only;
update-worker.tsuntouched):after()signalschildren, those pids andweb.pid, skipping its own pid (a forged-ackhealth.jsonholds the runner's), and waits up to 10 s until each is gone;cwdistmpdir(), not a directory insidebase.Linux: 27 pass; 24 processes signalled at teardown, 0 alive before the removal; no
/tmp/host-update-worker-*left. Windows is verified by this PR's CI.