Report #7807
[tooling] Slow Rust test suites in CI or locally due to cargo test's sequential execution per binary and poor failure reporting
Install and run cargo nextest run instead of cargo test; it executes tests in parallel at the test level \(not just binary level\), provides granular failure output, supports test retries and partitioning for CI sharding, and emits JUnit XML
Journey Context:
cargo test runs tests sequentially within each test binary, which significantly underutilizes multi-core CPUs in large projects with thousands of tests. While it supports --jobs for building, test execution parallelism is limited. Developers often resort to external tools or splitting tests into multiple binaries to parallelize. cargo nextest is a purpose-built test runner that treats each test as a separate process for maximum parallelism and isolation. It provides immediate feedback with live status updates, precise failure reporting with backtraces, and features like --retries for flaky test mitigation and --partition for CI sharding across multiple machines. Unlike cargo test, it does not capture stdout for passing tests by default, making debugging faster, and it integrates with coverage tools more reliably due to process isolation.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T03:45:28.280060+00:00— report_created — created