Skip to content

Make the connectors test cleanup stable (ENOTEMPTY flake) #532

Closed

Description

@HugoXK

What

core/test/connectors.test.js flakes: a test's temp home is still written by a background save that outlives dispose(), so rmSync in the cleanup hook sometimes fails with ENOTEMPTY: directory not empty. It fails a whole npm run verify / CI run at random (seen repeatedly today).

Expected behavior

  • The cleanup settles and retries; if it is still racing, it leaves the temp dir rather than failing the run. The test's own assertions have already passed by then.

Change scope

core/test/connectors.test.js (a cleanHome helper replacing the raw rmSync cleanups). Test only; no product behavior.

Why

Reliability: a flaky cleanup wastes a full CI run and can block a green PR at random (it has blocked my own verify evidence several times today).

Activity

  1. Birfy commented on Oct 20, 2026

    @Birfy
    Collaborator

    Triage (Birfy, 2026-10-20 20:08 Asia/Shanghai). Test-stability fix only: core/test/connectors.test.js cleanup sometimes hits ENOTEMPTY because a background save outlives dispose(). The fix is a cleanHome() helper that settles, retries, and otherwise leaves the temp dir. No product behavior and no owner design rule involved, so it is process/hygiene and needs no product decision.

    HugoXK's PR #533 implements it. Reviewed PASS at e4d3c7f, risk:T1, CI green. It is held only because it touches patches/ds-bot/0001-core-fixes.patch, which awaiting-approval PRs #515/#494/#493 also change. It will merge after those land, and that merge closes this issue. Follow-up note: if a save after dispose() ever shows up outside tests, that's a separate host bug.

  2. added
    bugSomething isn't working
    area:automationScheduled tasks and automation
    agent-readyMaintainer-approved spec: an agent may take it. Only maintainers set this; never in a template
    on Oct 20, 2026
  3. Birfy commented on Oct 20, 2026

    @Birfy
    Collaborator

    Owner decision (Danyang Chen, 2026-10-20 21:09 Asia/Shanghai): option (a), accept PR #533 as is (test-only, T1). It is queued only after #515 lands (#493 was closed, so #515 is the only thing it waits for). Labeled agent-ready per that decision; #533 is the implementation, so no separate development.

  4. added
    agent-workingAn agent has claimed this issue (the claim comment names the branch)
    on Oct 21, 2026
  5. Birfy commented on Oct 21, 2026

    @Birfy
    Collaborator

    Triage: the implementation PR #533 is open but stale — its head has not moved since 2026-10-20 15:06 (e4d3c7f6), it now conflicts with main, and the author has not replied.

    The bug itself is still valid (the connectors test cleanup is an ENOTEMPTY flake). Either the author merges main into the branch and pushes, or a maintenance round recaptures the fix on a fresh branch; until then this stays agent-working and is not merged.

  6. self-assigned this
    on Oct 21, 2026
  7. Birfy commented on Oct 21, 2026

    @Birfy
    Collaborator

    Recaptured by the maintenance round on a fresh branch fix/532-connectors-cleanup from main (105ec65b); PR #533 had not moved since 2026-10-20 15:06 and conflicts with main, so it is closed as superseded.

    The fix is the same idea plus a test that pins the contract: every cleanup goes through cleanHome, which retries a racing save and leaves the temp dir when it never settles. Test-only, T1.

  8. removed
    agent-readyMaintainer-approved spec: an agent may take it. Only maintainers set this; never in a template
    agent-workingAn agent has claimed this issue (the claim comment names the branch)
    on Oct 21, 2026
  9. added a commit that references this issue on Oct 21, 2026
    4da6a0d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:automationScheduled tasks and automationbugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions