Repository navigation
Fix storage protection test racing background trash deletion - #6478
Merged
Merged
Conversation
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.
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
expected 2 to be 1orphan-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.tsandgit diff --checkpassed.