Repository navigation
test(cleanup): stop part cleanup test from flaking when the Merge finishes early - #322
Merged
Merged
Conversation
…ishes early The second full download could open after the Merge completed, read the merged object under a Storage lease, and leave the Parts unprotected. Open the Parts reader first as a ranged read, which always reads Parts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
🚀 Deploying Preview to Cloudflare 🚀Preview Deployments by commit
|
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.
📝 Summary
CI on
devfailed onpart_cleanup_waits_for_an_active_parts_download(Postgres jobs, any storage; it also failed on the #319 and #321 PR runs). The server is correct. The test has a race.The test opened two full downloads one after the other. When the Merge finished before the second download opened, that download read the merged object under a Storage Reader Lease, not a Part Reader Lease. Nothing then protected the Parts, so Part cleanup correctly deleted them, and the assertion saw 0 Parts.
Now the Parts reader opens first, as a ranged read. A ranged read always reads Parts and never starts a Merge, so it holds a Part Reader Lease on every backend.
✅ Verification
Forced the race by waiting 300 ms after the first download (so the Merge finishes) and after
wait_for_ongoing_merges(so the first lease is released):assertion left == right failed: parts are still being read, left: 0, right: 2After: sqlite and postgres:
1 passedGate:
cargo +nightly fmt --checkandcargo clippy --all-targets --lockedare clean.cargo testpasses on sqlite+filesystem and postgres+filesystem (84/84).💥 Merge danger
Door: two-way
Blast Radius: tests-only
🤖 Generated with Claude Code