Skip to content

Tests make the bucket once per process; app job prints RustFS's log on failure - #225

Open
ndbroadbent wants to merge 1 commit into
mainfrom
fix/test-bucket-once
Open

ndbroadbent wants to merge 1 commit into
mainfrom
fix/test-bucket-once

Conversation

@ndbroadbent

@ndbroadbent ndbroadbent commented Dec 4, 2026 •

Copy link
Copy Markdown
Member

The baselines flake survived #217. In run 47389263799 (#222, which includes #217), three baselines tests still got HTTP 404 NoSuchBucket on their first upload, about a second into the test binary. So ensure_bucket saw the bucket answer to HEAD, and the upload straight after was told it doesn't exist. The bucket existed, then went missing.

I can't reproduce it. On fresh RustFS 1.0.6 containers on agents-box-2, none of these failed:

  • 20 concurrent creators of one bucket, each creating it 15 times, during 8,100 uploads;
  • 6 full runs of the app test binary;
  • concurrent creates followed straight away by uploads.

So this PR does two things.

1. Once per process. fixtures::blob_store() creates the bucket once per test process, in a process-wide tokio::sync::OnceCell, instead of every test creating it. The tests in the one binary start together, and every observed failure was during that burst of concurrent creates on a fresh store. With this change, nothing in the process can create the bucket concurrently any more.

  • The app's tokio dependency gains the sync feature, for OnceCell. Other crates already compile it, so Cargo.lock doesn't change.

2. Evidence if it recurs. When the app job fails, it prints the last 300 lines of the RustFS container's log. If the bucket still goes missing, the store's own account will be in the run.

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


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

…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.

This branch has not been deployed

No deployments
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