Repository navigation
Make the connectors test cleanup stable (ENOTEMPTY flake) - #560
Merged
Merged
Conversation
A test's temp home can still be written by a background save that outlives dispose(), so the raw rmSync cleanup sometimes raced and failed the whole run with ENOTEMPTY. The cleanup now settles and retries, and leaves the temp dir when it is still racing; a test pins that contract. Test-only. Recaptured from #533 on a fresh branch (#532); the owner's session had let that branch go stale against main. Fixes #532
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.
Fixes #532
core/test/connectors.test.jsflaked: a test's temp home can still be written by a background save that outlivesdispose(), so the rawrmSynccleanup sometimes failed the whole run withENOTEMPTY. Every cleanup now goes throughcleanHome, which settles and retries (5 tries, 50 ms apart,rmSyncitself withmaxRetries/retryDelay) and leaves the temp dir when it is still racing — the assertions have already passed by then. Any other error still surfaces. Because the failure is a race, a test pins the retry contract instead of waiting for a flake: ENOTEMPTY/EBUSY settle, a directory that never settles is left behind, EACCES still rejects.This recaptures #533 on a fresh branch from
main(105ec65b); that PR had not moved since 2026-10-20 15:06 and conflicts withmain, so it is closed as superseded.Tier: T1 (test-only, no product behavior).
Ran at the tip: connectors 29/29 four runs in a row (no flake);
ds-bot-patches check(pin v0.1.5, 10 patches, core == ds-bot + patches);arch-docs OK (2 changed file(s)); core lint 0 errors, 41 warnings, none in the touched file.TZ=UTC.Not run: one-shot
npm run verify(2 GiB container OOMs it), the full core suite (CI'stests-okcovers it), smoke, Desktop.