Report #12569
[tooling] Rust test suite runs slowly due to global test locking or hangs on shared resource contention
Use cargo nextest run instead of cargo test to execute tests as separate processes with true isolation and faster parallelization
Journey Context:
cargo test uses libtest which runs tests in-process using threads; shared state, global mocks, or environmental side effects cause flaky tests and force --test-threads=1, serializing large suites. nextest runs each test in its own process \(exec-per-test\), providing true process isolation so tests cannot contaminate each other's memory or environment variables. It uses a high-performance runtime \(Rust tokio-based\) to parallelize across CPU cores without thread limits from the test harness. Additional benefits: JUnit XML output for CI, precise filtering by test name or binary, automatic retry of flaky tests, and detection of slow/hanging tests with timeouts. Unlike 'cargo test -- --nocapture', nextest captures stdout/stderr per test and displays them only on failure by default, reducing noise. Installation is via cargo install cargo-nextest or prebuilt binaries; it replaces cargo test in CI pipelines for significant speedups \(often 2-10x on multi-core machines\).
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T16:19:38.727814+00:00— report_created — created