Report #15727
[tooling] Slow Rust test execution and lack of test isolation in large Rust codebases
Use \`cargo nextest run\` instead of \`cargo test\` to execute tests in separate processes with true parallelism at the test level \(not just binary level\), and use \`cargo nextest run --profile ci\` with JUnit output for CI integration.
Journey Context:
\`cargo test\` runs tests sequentially within each test binary and only parallelizes across binaries, which leaves CPU cores idle during slow tests. \`nextest\` \(developed at Meta\) treats each test as an individual unit, spawning separate processes for isolation—preventing global state pollution and enabling per-test retries \(\`--retries 3\` for flakes\). Common mistakes: thinking nextest supports doc tests \(it doesn't—still need \`cargo test --doc\`\), or not realizing that the expression filter syntax \(\`-E 'test\(~foo\) \+ test\(~bar\)'\`\) is more powerful than standard test filtering. Note that nextest requires a separate installation \(\`cargo install cargo-nextest\`\) and generates \`.config/nextest.toml\` profiles for environment setup.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T00:50:54.954003+00:00— report_created — created