Repository navigation
tests: run with cargo-nextest and in parallel - #3077
Merged
sylvestre merged 9 commits intoDec 2, 2026
Merged
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3077 +/- ##
==========================================
+ Coverage 80.69% 80.71% +0.01%
==========================================
Files 78 80 +2
Lines 48640 48756 +116
==========================================
+ Hits 39252 39352 +100
- Misses 9388 9404 +16 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
loganrosen
force-pushed
the
loganrosen-switch-tests-to-nextest
branch
from
November 29, 2026 01:50
b7cf91e to
05bd4a5
Compare
loganrosen
marked this pull request as ready for review
November 29, 2026 01:50
sylvestre
reviewed
Nov 29, 2026
sylvestre
reviewed
Nov 29, 2026
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Integration tests that start or query a server used the default address and built the shared tests/test-crate, so they were marked #[serial] and, under nextest, put in a single-threaded test group. Point every test at a server address private to its thread (a Unix socket in a tempdir, or a reserved free port on Windows), copy test-crate into each SccacheTest's tempdir, and stop any server left on that address when the test ends. The tests now run in parallel; only the dist tests stay grouped. Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
With nextest every test is its own process, so %p produced hundreds of profraw files and doubled the grcov step. %8m alone merges online into a small pool per binary. Co-authored-by: Copilot App <[email protected]>
Each DistSystem now reserves its own scheduler and server ports instead of using 10500 and 12345, so the dist tests no longer need a serial test group. A port released after probing can be handed out again right away, so the port is also claimed with a lock on a file in a shared temp directory, held until the dist system is torn down. The Windows client address uses the same helper. Co-authored-by: Copilot App <[email protected]>
loganrosen
force-pushed
the
loganrosen-switch-tests-to-nextest
branch
from
November 29, 2026 17:01
150bd00 to
590a1ce
Compare
Verify the nextest archive's sha256, share the test-crate copy between SccacheTest and build_checkout, and shorten the nextest notes. Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
loganrosen
force-pushed
the
loganrosen-switch-tests-to-nextest
branch
from
November 29, 2026 17:19
590a1ce to
f7c7b5f
Compare
sylvestre
reviewed
Nov 29, 2026
Co-authored-by: Copilot App <[email protected]>
Collaborator
|
Thanks for your PR |
art-shen
added a commit
to art-shen/sccache
that referenced
this pull request
Dec 2, 2026
…port A fixed port can clash with another sccache on the machine. Each test already has its own server socket since mozilla#3077, but the server `SccacheTest` starts can still be shutting down when the first build runs; the build then reaches it instead of starting one, and the test passed without the fix. A socket no server has used avoids both. Without the fix the test fails with "Failed to create temp dir".
This was referenced Dec 2, 2026
sylvestre
pushed a commit
that referenced
this pull request
Dec 3, 2026
cargo clippy --all-targets fails on main because tests/sccache_args.rs no longer compiles: the server connection failure tests from 08f94c4 still used SCCACHE_BIN and #[serial], whose imports were removed by #3077. Use sccache_command() and drop #[serial] like the rest of the file; these tests use their own tempdir and socket path, so they don't need to run serially.
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.
Switch the CI test job from
cargo testto cargo-nextest, and make the integration tests safe to run in parallel.Why: nextest runs each test in its own process, so a test that leaks env vars, global state or a panic can't affect the next one. It also gives clearer failure output and flags slow tests, which makes intermittent CI failures easier to pin down.
The integration tests all used the default server port and shared
tests/test-crate, so they could only run one at a time. Each test thread now gets its own server address (a Unix socket in a tempdir, or a reserved free port on Windows), andSccacheTestcopies test-crate into its tempdir. That lets#[serial]come off system, sccache_args, sccache_cargo, cache_hit_rate and logging. The dist tests used fixed scheduler and server ports with host networking; each dist system now reserves its own ports, so those run in parallel too and the dist-tests job went from ~730s on main to ~365s. No nextest test groups are needed. The#[serial]tests in src/ only guard env vars, so they stay for plaincargo testand nextest's process isolation covers them. Locally the nextest run went from about 83s to 35s.nextest is downloaded as a pinned prebuilt binary from get.nexte.st (a third-party install action isn't on the org allowlist).
LLVM_PROFILE_FILEhad%p, so every instrumented process (each sccache client and server the tests start, and now each test too) wrote its own profraw file, and with nextest grcov took about twice as long as on main. It now uses only%8m, so processes merge into a small pool of files. The coverage total is unchanged (80.7%), and each of the two grcov steps dropped from ~45s on main to ~10s.CI never ran doctests (
--lib --bins --tests), so there's no separate doctest step. AGENTS.md is updated to match.I tested locally on macOS only, on stable and 1.91.0.