Repository navigation
Conversation
A test's temp home can still be written by a background save that outlives dispose(), so a plain rmSync sometimes raced and failed the run with ENOTEMPTY. Settle and retry; if it is still racing, leave the temp dir (the assertions already passed). Test-only.
|
Review (Birfy, 2026-10-20 20:07 Asia/Shanghai): PASS Tip SHA: e4d3c7f
Findings: no actionable findings. Test-only: the raw Merge: risk:T1, green, mergeable. Held for now: it touches |
|
This PR is Please merge |
|
Superseded by #560: the maintenance round recaptured this on a fresh branch from |
…ab#560) Fixes ThinkFlowLab#532 `core/test/connectors.test.js` flaked: a test's temp home can still be written by a background save that outlives `dispose()`, so the raw `rmSync` cleanup sometimes failed the whole run with `ENOTEMPTY`. Every cleanup now goes through `cleanHome`, which settles and retries (5 tries, 50 ms apart, `rmSync` itself with `maxRetries`/`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 ThinkFlowLab#533 on a fresh branch from `main` (`105ec65b`); that PR had not moved since 2026-10-20 15:06 and conflicts with `main`, 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's `tests-ok` covers it), smoke, Desktop.
Make the connectors test cleanup stable (ENOTEMPTY flake)
The connectors test flaked: a test's temp home is still written by a background save that outlives
dispose(), sormSyncin the cleanup hook sometimes failed withENOTEMPTY, failing a wholenpm run verify/ CI run at random. The cleanup now settles and retries, and leaves the temp dir if it is still racing (the assertions have already passed). Test-only.Ran at the tip:
npm run verify(green,TZ=UTC), the connectors suite 5× and the full core suite 2× (all green). Not run: smoke, Desktop, real-model steward.