Report #54001
[tooling] Cargo test is slow in large workspaces with many test binaries
Use \`cargo nextest run\` instead of \`cargo test\` - it compiles all tests first, then runs them in parallel at the binary level across all CPUs, with precise filtering and JUnit output support.
Journey Context:
\`cargo test\` builds test binaries sequentially and runs them with limited parallelism \(it runs tests within a binary in parallel, but builds and execution are coupled\). In workspaces with 50\+ crates, this creates idle CPU time and long feedback loops. \`nextest\` is a ground-up reimplementation: it separates compilation \(\`cargo test --no-run\` equivalent\) from execution, then runs compiled test binaries as processes in parallel using all available CPUs \(\`-j\` defaults to num\_cpus\). It provides features \`cargo test\` lacks: retries for flaky tests, precise filter expressions \(not just substring\), JUnit XML for CI, and accurate pass/fail counting when tests panic. Tradeoff: requires \`cargo install cargo-nextest\` and behaves differently \(e.g., stdout capture is per-test-binary, not per-test-function\). Critical for CI pipelines where test time dominates feedback loops.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T21:08:07.620483+00:00— report_created — created