Repository navigation
app tests: one test binary instead of 53 - #176
Merged
Merged
Conversation
VisualCIdocspring/visualci · build #694 · 510 unchanged · no changes This PR vs base: 32 changed, 118 added since #425, across 6 builds docspring/visualci · journeys · build #692 · 50 unchanged · no changes This PR vs base: 6 changed, 20 added since #401, across 10 builds Updated as builds change. Agents can review with VisualCI's MCP tools. |
ndbroadbent
force-pushed
the
ci/app-tests-one-binary
branch
2 times, most recently
from
December 4, 2026 07:08
03b283b to
2538f84
Compare
ndbroadbent
force-pushed
the
ci/app-tests-one-binary
branch
2 times, most recently
from
December 4, 2026 12:27
e425e40 to
ac4eaef
Compare
Each file in app/tests was its own test binary: every run linked the whole app 53 times, then cargo ran the binaries one after another. They're now modules of tests/all.rs, linked once, with every test running in parallel (Laravel Rust gives each test its own application and database). live_limits, mcp_hosts and proxies say they need a process of their own, so they stay separate [[test]] targets. A test fails if a file in tests/ is in neither list, since autotests is off.
…binary; guard requires exactly one listing From the review: main gained three test files; live.rs must start the live-updates listener on its own runtime, which only alphabetical order guaranteed in the shared binary; and a file listed in both places would run twice.
The tests are bound by the runner after all, so more threads only meant more database copies.
ndbroadbent
force-pushed
the
ci/app-tests-one-binary
branch
from
December 4, 2026 12:39
8a448db to
2d72bfa
Compare
ndbroadbent
added a commit
that referenced
this pull request
Dec 4, 2026
…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.
ndbroadbent
added a commit
that referenced
this pull request
Dec 4, 2026
…s answer (#211) * baselines tests: retry the store's 429/5xx as the CLI does, and say what 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. * baselines tests: each test's images get bytes of their own (a tEXt nonce, 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
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).
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.
The
appjob'scargo teststep took 145–233 s in recent runs: about 131 s compiling and linking, then about 74 s running 53 test binaries one after another (run 47272907438).app/tests/all.rsdeclares every test file as a module, andapp/Cargo.tomlsetsautotests = falsewith one[[test]]for it. The shared helpersgoldenandoauth_clientare declared once there, and the files that used themuse crate::…instead.live_limits,mcp_hostsandproxieskeep their own binaries: each says it needs its own process (a per-process counter, or the MCP service built from the first test's settings).every_test_file_is_listedfails if a file intests/is in neither list, so a new test file can't silently stop running.cargo test -p visualci-app <file>::. Nothing in the repo used--test <file>.I checked the other process-wide statics for problems across files: the
/mcpand admin MCP services, the Stripe catalog, the live hub and the gallery cache. Within each file they were already shared, and the only file that depends on host settings (mcp_hosts) stays separate.hosts.rsandsign_in.rsexpect only the host check's 404, which runs before the service is built.Checked on the build pool: clippy
--all-targets -D warningsis clean. The full app suite passed three times in a row, with 302 tests in the shared binary in 32–38 s (after the rebase), plus the three separate binaries.Before and after, measured on what this is for: a PR that changes
app/src. I ran the same one-line change twice with workflow_dispatch, once on main and once on this branch:cargo teststepOn a PR that doesn't touch
app/srcit changes little (149 s against 145–154 s), because rust-cache already has the test binaries. I also triedRUST_TEST_THREADS=12: the tests took 73 s against 75 s, so I reverted it.Also from the review:
mainhad gained three test files, now listed.live.rsgets its own binary, because its listener test needs to start first, which only alphabetical order guaranteed. The guard now fails if a file is listed twice.