Skip to content

Make the connectors test cleanup stable (ENOTEMPTY flake) - #560

Merged
Birfy merged 1 commit into
mainfrom
fix/532-connectors-cleanup
Oct 21, 2026
Merged

Birfy merged 1 commit into
mainfrom
fix/532-connectors-cleanup

Conversation

@Birfy

@Birfy Birfy commented Oct 21, 2026

Copy link
Copy Markdown
Collaborator

Fixes #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 #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.

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
@Birfy Birfy added the agent-pr Pull request opened by an agent label Oct 21, 2026
@Birfy Birfy self-assigned this Oct 21, 2026
@Birfy
Birfy added this pull request to the merge queue Oct 21, 2026
Merged via the queue into main with commit 4da6a0d Oct 21, 2026
8 checks passed
@Birfy
Birfy deleted the fix/532-connectors-cleanup branch October 21, 2026 00:42
@Birfy Birfy removed the agent-pr Pull request opened by an agent label Oct 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make the connectors test cleanup stable (ENOTEMPTY flake)

1 participant