test: retry transient Windows removals ourselves (Bun ignores fs.rm maxRetries) - #9026
Closed
code-yeongyu wants to merge 4 commits into
Closed
code-yeongyu wants to merge 4 commits into
code-yeongyu wants to merge 4 commits into
Conversation
…ase window (#9025) Deleting the scratch dir right after running the relocated omo.exe raced Windows' post-exit image lock and failed with EBUSY although the test passed. Use the same bounded retry window the isolation-core fixtures use for this EBUSY family.
…9025) Bun parses fs.rm maxRetries/retryDelay but never retries (oven-sh/bun#41480). removeTree/removeTreeSync retry EBUSY, EPERM, EMFILE, ENFILE and ENOTEMPTY with linear backoff and rethrow the real error when the budget runs out.
66 cleanups in 65 test files passed maxRetries/retryDelay to fs.rm, which Bun ignores, so their Windows EBUSY retries never ran. Each now keeps its retry budget through removeTree/removeTreeSync. The compiled-worker test's buildRoot removal is included.
Owner
Author
|
Focused Windows soaks of this head (windows-latest, 20 iterations each; script/senpi-worker-compile.test.ts + packages/isolation-core/src/git + test-support + packages/memory-core/src/git): 36345727979 success, 36345729528 success, 36345731033 success. |
… test (#9025) The relocated-worker job copies the worker test away from the repository to prove the compiled worker needs no source tree. The test now imports test-support/remove-tree (node builtins only), so the job mirrors the script/ and test-support/ layout in its scratch directory.
Owner
Author
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.
Summary
Test cleanups across the repo passed
maxRetries/retryDelaytofs.rm/fs.rmSyncto absorb Windows EBUSY on temp-dir teardown. Bun 1.4.2 parses those options and never retries (oven-sh/bun#41480, still open), so every one of those retries was inert. This PR routes them through one helper that does the retry itself.Root cause
maxRetries: 10, retryDelay: 500failed again in a focused soak (run 36343784552, iteration 16). The whole test took 1382 ms, so the 5 s retry window never ran.fs.rmignores both options. The same inert pattern is in 66 cleanups across 65 test files (memory-core, omo-senpi memory commands, isolation-core's shared fixture, script tests), feeding the rotating Windows teardown failures in ci(windows): dev push CI fails a rotating Windows test by timeout on every run, blocking the publish gate #8324.Fix
test-support/remove-tree.ts:removeTree/removeTreeSynccallrm(path, { recursive: true, force: true })and retry EBUSY, EPERM, EMFILE, ENFILE and ENOTEMPTY with linear backoff. When the budget runs out they rethrow the original error. Non-transient errors rethrow immediately. The sync path usesBun.sleepSync, falling back toAtomics.waitunder node..tscall site keeps its existing retry numbers. Existing.catch(() => undefined)wrappers are unchanged.packages/omo-codex/plugin/scripts/sync-skills.mjsandpackages/omo-senpi/plugin/scripts/sync-skills.mjsare shipped build scripts, and twopackages/omo-senpi/scripts/qa/*-e2e.mjsdrivers run under node and cannot import a TS helper. Their options are equally inert and are left as-is.QA & Evidence
bun test test-support packages/isolation-core packages/memory-core script/senpi-worker-compile.test.ts: 1212 pass, 11 skip, 0 fail.bun test packages/omo-senpi/src/components/memory: 1644 pass, 0 fail.tsgo --noEmitfor memory-core, omo-senpi, isolation-core and script is clean, and biome is clean.git grep -E "(rm|rmSync)\\([^)]*maxRetries"over.tsreturns only the helper.Fixes #9025
Refs #8324