Skip to content

baselines tests: retry the store's 429/5xx like the CLI, and print its answer - #211

Merged
ndbroadbent merged 2 commits into
mainfrom
fix/baselines-upload-flake
Dec 4, 2026
Merged

ndbroadbent merged 2 commits into
mainfrom
fix/baselines-upload-flake

Conversation

@ndbroadbent

@ndbroadbent ndbroadbent commented Dec 4, 2026 •

Copy link
Copy Markdown
Member

Since #176 (one integration test binary), app/tests/baselines.rs' five upload tests sometimes fail together on CI, all at baselines.rs:137, within a second of each other, about 10 s into the run. Other uploads in the same run pass. Reported by the gallery session.

Failing runs:

The assert didn't print the status, so the cause isn't known yet. I tried to reproduce it on agents-box-2, and none of these failed:

  • 6 full runs of the app test binary (349 tests each), against fresh Postgres and RustFS 1.0.6.
  • 100 concurrent presigned PUTs to one key on RustFS 1.0.6, with DELETEs, GETs and HEADs mixed in.
  • Concurrent bucket creation followed straight away by PUTs, on 6 fresh RustFS containers.

I also checked whether any test changes S3 settings, process env, proxies or the clock for the whole binary. None does.

Change (test-only):

  • The upload helper now PUTs the way the CLI does (crates/visualci-cli/src/client.rs, retryable): a 429 or 5xx from the store is tried again, up to 4 tries with a short backoff, and each retry is printed.
  • Any other failure fails the test with the URL, status and body. If the cause is a 4xx, the next failure names it.

Locally: cargo test -p visualci-app --test app baselines passes (15), and clippy is clean.

Update (second commit), after an independent review. The likely trigger is one hot key. Every test built the identical 8x6 PNGs, so in the one binary, baselines (and gallery, retention, project_deletion) all wrote and verified the same blobs/<sha256> together at start-up. On a busy runner, a 503 from RustFS's per-object lock is a plausible result.

  • Bytes: each World now puts a nonce in a tEXt chunk, so the pixels and fingerprints are the same and the blob key is the test's own. A new test checks this.
  • Retries: 6 tries; the wait starts at 0.5 s and doubles, plus up to half again at random, as the CLI does.

Locally: the full app test binary passes (350), and clippy is clean.

Follow-up story sc-9380: BlobStore::verify deletes the object on any mismatch, including a plain 404. With keys shared across customers, a race could delete an object someone else still needs.

…hat it answered

Since #176 put every integration test in one binary, baselines' five upload tests sometimes fail together on CI
(runs 47362577655, 47345661986, main ef8a7a9), all at baselines.rs:137, within a second of each other, about 10 s
into the run, while other uploads in the same run pass. The assert didn't print the status, so the cause is unknown,
and it doesn't reproduce locally (6 full runs, fresh RustFS, 100 concurrent PUTs to one key with DELETEs mixed in).

The helper now PUTs as the CLI does (client.rs retryable: 429 and 5xx tried again, each retry printed) and fails
with the URL, status and body otherwise, so a 4xx cause shows itself on the next failure.
…nce, same pixels); jittered backoff like the CLI

Every test built the identical 8x6 PNGs, so with all tests in one binary, baselines (and gallery, retention,
project_deletion) wrote and verified the same blobs/<sha256> at once. A per-World nonce in a tEXt chunk keeps the
pixels and fingerprints and gives each test its own key. Retries now wait 0.5 s doubling plus up to half again at
random, 6 tries, as the CLI does.
@ndbroadbent
ndbroadbent force-pushed the fix/baselines-upload-flake branch from 3416917 to a16553d Compare December 4, 2026 16:11
@ndbroadbent
ndbroadbent merged commit 181d004 into main Dec 4, 2026
16 checks passed
@ndbroadbent
ndbroadbent deleted the fix/baselines-upload-flake branch December 4, 2026 16:21
ndbroadbent added a commit that referenced this pull request Dec 4, 2026
…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 added a commit that referenced this pull request Dec 4, 2026
…e since #176) (#217)

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