Report #57277
[tooling] Rust cargo test is slow with many test binaries, lacks proper test filtering granularity, or produces unstructured output in CI
Use cargo nextest: cargo install cargo-nextest && cargo nextest run. Runs tests in parallel at the test binary level \(not just within binaries\) with fine-grained filtering: cargo nextest run -E 'test\(/^my\_module::/\)'. Provides JUnit XML for CI: --junit-xml. Features: retries for flaky tests \(--retries 3\), partition support for sharding across CI workers \(--partition count:1/4\), and accurate test listing \(nextest list\).
Journey Context:
cargo test runs test binaries sequentially, waiting for all tests in one binary before starting the next, leaving CPUs underutilized. It lacks machine-readable output formats for CI analysis. nextest partitions work across CPUs at test granularity while respecting binary boundaries for linking overhead. It distinguishes between setup/teardown failures vs test failures. Used by rustc, tokio, and other large projects. Unlike cargo test, nextest runs each test in a separate process, preventing global state pollution between tests.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T02:37:41.496951+00:00— report_created — created