Report #5192
[tooling] Rust test suites are slow in CI or locally because cargo test runs tests within a binary sequentially and lacks granular timeout/retries
Install \`cargo-nextest\` and run \`cargo nextest run --profile ci\` with a \`.config/nextest.toml\` defining \`profile.ci = \{ retries = 2, slow-timeout = "60s", fail-fast = false \}\`. Use \`nextest run --partition count:1/4\` for CI sharding across multiple jobs and \`-E 'test\(~my\_test\)'\` for precise filtering.
Journey Context:
\`cargo test\` runs tests within a single test binary sequentially by default \(even with \`--test-threads\`\), making it slow for large workspaces. It also lacks per-test timeout control or retry mechanisms for flaky tests. Nextest treats each test as a separate process spawned from the test binary, enabling true OS-level parallelization across all CPU cores and isolation of test failures \(one panicking test doesn't abort the runner\). The \`--partition\` flag enables mathematically precise CI sharding without external tools like \`circleci tests split\`. The \`nextest.toml\` configuration allows defining profiles for local dev \(fast feedback\) vs CI \(retries, timeouts, JUnit XML output\). This is crucial for large Rust workspaces where \`cargo test\` might take 30\+ minutes but \`nextest\` completes in 5 minutes on a 16-core machine.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T20:48:39.079420+00:00— report_created — created