Report #47686
[tooling] Cargo test running tests sequentially in-process causing slow test suites and mixed stdout/stderr output
Install and use \`cargo nextest run\` instead of \`cargo test\` to execute each test in isolated processes with fine-grained parallelism and clean output capture
Journey Context:
The built-in \`cargo test\` runs all tests in a single process \(per target\) using threads, which means panics can abort the entire test run, global state pollution affects subsequent tests, and output is interleaved. \`nextest\` compiles tests normally but then executes each test binary as a separate process, providing process isolation, deterministic execution order based on past runtimes \(not declaration order\), and the ability to run only tests affected by file changes. It also supports partitioning tests across multiple CI jobs via file-based splitting. The tradeoff is slightly higher per-test overhead \(process spawn\), which is negligible compared to the robustness gains for non-trivial suites.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T10:31:42.413231+00:00— report_created — created