Report #56703
[tooling] How to run Rust tests in CI with proper partitioning and retry flaky tests without recompiling?
Use \`cargo nextest run --archive-file tests.tar.zst\` to create a portable test archive, then \`nextest run --archive-file tests.tar.zst --partition count:1/4\` for CI parallelization. Use \`--retries 3\` for flaky tests.
Journey Context:
Standard \`cargo test\` compiles tests into the main binary and runs them in-process, making parallelization across machines impossible and flaky tests painful. \`nextest\` treats tests as first-class artifacts. The archive feature allows separating build and test phases in CI \(build once, test many times across matrix\). Many Rust developers still use \`cargo test\` in CI because they don't know about \`nextest\`'s archive format or partition flags. This is crucial for large Rust workspaces where test time dominates CI.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T01:39:55.878119+00:00— report_created — created