Skip to content

ensure_bucket: wait until the bucket answers (the baselines flake's NoSuchBucket race) - #217

Merged
ndbroadbent merged 1 commit into
mainfrom
fix/test-bucket-race
Dec 4, 2026
Merged

ndbroadbent merged 1 commit into
mainfrom
fix/test-bucket-race

Conversation

@ndbroadbent

@ndbroadbent ndbroadbent commented Dec 4, 2026 •

Copy link
Copy Markdown
Member

Fixes the root cause of the baselines flake that #176 brought, which turned main red on 40dcc92 (run 47378633259).

#211's diagnostic printed the store's answer:

PUT http://127.0.0.1:59000/visualci-test/blobs/91e8…?… (try 1): HTTP 404 Not Found: <Error><Code>NoSuchBucket</Code>…

Cause: with every integration test in one binary, baselines' tests are the first to touch storage. They all call fixtures::blob_store() → ensure_bucket() at once on a fresh RustFS. A caller can get 409 (already exists, counted as success) while another caller's create is still in progress, and its upload straight after gets NoSuchBucket. Before #176, an earlier test binary had created the bucket long before.

Fix: after the create call answers 200 or 409, ensure_bucket waits until HEAD on the bucket answers (100 ms polls, up to 10 s). It's only used by the test fixture and in development; production buckets come from Terraform.

Locally, on fresh Postgres and RustFS containers: the full app test binary passes (350), and clippy is clean.


Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

…e since #176)

The baselines flake's cause, printed by #211's diagnostic on main 40dcc92: HTTP 404 NoSuchBucket. In one test
binary, baselines' tests all create the bucket at once on a fresh RustFS; one gets 409 while another's create is in
progress, and its upload then finds no bucket. ensure_bucket now polls HEAD bucket until it answers (up to 10 s).
@ndbroadbent
ndbroadbent merged commit c51c149 into main Dec 4, 2026
16 checks passed
@ndbroadbent
ndbroadbent deleted the fix/test-bucket-race branch December 4, 2026 17:31
ndbroadbent added a commit that referenced this pull request Dec 4, 2026
…og when it fails

#217 didn't end the baselines flake: run 47389263799 (#222) still got NoSuchBucket on first uploads, after HEAD
bucket had answered. Every failure was in the burst of concurrent creates as the one test binary starts, so the
fixture now creates the bucket once per process (a tokio OnceCell), and a failed app job prints the store's log.
ndbroadbent added a commit that referenced this pull request Dec 4, 2026
…og when it fails (#225)

#217 didn't end the baselines flake: run 47389263799 (#222) still got NoSuchBucket on first uploads, after HEAD
bucket had answered. Every failure was in the burst of concurrent creates as the one test binary starts, so the
fixture now creates the bucket once per process (a tokio OnceCell), and a failed app job prints the store's log.
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