Skip to content

Fix storage protection test racing background trash deletion - #6478

Merged
ymichael merged 1 commit into
mainfrom
bb/ci-flake-followup
Oct 28, 2026
Merged

ymichael merged 1 commit into
mainfrom
bb/ci-flake-followup

Conversation

@ymichael

Copy link
Copy Markdown
Collaborator

Human comments

What was wrong

The workspace-protection test scanned storage immediately after clearing another thread's files. The real cleanup handler returns after moving those files to a .bb-trash-* directory and deletes the trash in the background. If the scan won that race, it correctly counted the temporary trash as an extra orphan. This matches the Windows failure in run 40578948054: expected one orphan, observed two.

What changed

Wait for the host test harness's retained cleanup workers to finish before scanning. This adds three test-only lines using the same completion check already present in the test's teardown. All workspace-protection and orphan-removal assertions remain intact. No production, timeout, retry, cache, or workflow changes.

How you verified

  • A temporary diagnostic held real trash deletion until after the real disk measurement, releasing it earlier if the fixture awaited worker completion. Baseline failed with the exact expected 2 to be 1 orphan-count error; the repaired fixture passed with the same scheduling. Instrumentation was removed before committing.
  • pnpm exec turbo run test lint typecheck --filter=bb-plugin-bb--storage-retention: all 82 tests across four files passed; lint/typecheck passed.
  • pnpm exec oxfmt plugins/storage-retention/src/storage.test.ts and git diff --check passed.

AGENT GENERATED

@ymichael
ymichael merged commit b2f6c72 into main Oct 28, 2026
30 checks passed
@ymichael
ymichael deleted the bb/ci-flake-followup branch October 28, 2026 20:30
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.

1 participant