Report #15352
[tooling] Rust test suites run slowly in CI or fail to isolate shared state between tests
Install \`cargo-nextest\` and run \`cargo nextest run\` instead of \`cargo test\`. Nextest compiles tests once but executes each test as a separate process \(true isolation\), provides precise test listing, retries with \`--retries\`, and JUnit XML output via \`nextest-archive\`.
Journey Context:
\`cargo test\` runs tests in a single process using libtest. This means a panic or segfault in one test aborts the entire suite, and global state \(static mutables, env vars\) leaks between tests. libtest also lacks machine-readable output formats and proper retry logic. \`nextest\` treats each test binary as a crate but runs each test function in isolation via process forking \(on Unix\) or process spawning \(on Windows\). This is slower per-test but enables true parallelism without race conditions and prevents total suite failure on crash. The \`--archive\` feature allows separating compilation \(CI build\) from execution \(CI test farm\), which is impossible with standard cargo test. Common confusion: nextest does not compile tests differently; it replaces the test runner, not the compiler.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T23:50:55.863954+00:00— report_created — created