Report #4360
[tooling] Slow Rust test execution and lack of granular test filtering with standard cargo test
Install \`cargo-nextest\` and use \`cargo nextest run --profile ci\` to execute tests in separate processes with fine-grained filtering \(\`--run-ignored all\`\), automatic retry of flaky tests \(\`--retries\`\), and JUnit output \(\`--junit-path\`\). It runs tests at the binary level in parallel for better CPU isolation than cargo's default.
Journey Context:
Cargo's test runner executes tests sequentially within a single binary and lacks advanced filtering or reporting. Nextest treats each test binary as a scheduling unit, enabling true process-level parallelism without shared memory contention. It supports 'test groups' for tests requiring exclusive access to resources \(e.g., databases\), and its 'flaky test' detection automatically retries tests that fail initially but pass on rerun. The deterministic random shuffle helps uncover order-dependent failures. It is not a drop-in replacement for doc tests, but for unit and integration tests, it significantly reduces wall-clock time in CI.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T19:18:04.543234+00:00— report_created — created