CheckOps home

Tools directory

C

CheckOps

cargo-nextest

cargo-nextest is an Apache-2.0 next-generation test runner for Rust, up to 3x faster than cargo test per its site, with per-test process isolation, retries, partitioning, JUnit output and a filterset DSL.

Visit website

Latest public signals

Not refreshed yet. Refresh reads the public site and, when the entry has a GitHub repository, the latest release.

Visit Website

Introduction

cargo-nextest is a next-generation test runner for Rust. Its website describes it as up to three times faster than cargo test, with a modern interface, per-test isolation and first-class CI support. The repository also contains the libraries behind it: nextest-runner for core logic, nextest-metadata for calling nextest from other tools, and nextest-filtering for its filterset language.

The key design difference from cargo test is that nextest runs each test in its own process. Cargo’s built-in harness runs tests from one binary as threads in a single process, so a test that crashes, leaks global state or hangs can affect others. Nextest’s process-per-test model isolates tests, lets it schedule tests across all binaries at once for better parallelism, and makes features such as per-test timeouts and retries reliable.

The README notes a very low minimum Rust version for running nextest (Rust 1.41, though not tested that far back) and requires a recent stable Rust (1.91 at the time of review) to build it. Pre-built binaries are available for major platforms, so CI does not need to compile it. The latest release, cargo-nextest 0.9.151, was published on 3 November 2026.

The documentation covers a wide range of features: retries and flaky-test detection, slow-test warnings and timeouts, record-and-replay of test runs (including rerunning only failures and Perfetto traces), leaky-test detection, stress tests, archiving builds to run tests on another machine, partitioning and sharding across CI jobs, test priorities, heavy tests that take several slots, mutual exclusion and rate limiting, setup scripts and wrapper scripts. Integrations include VS Code, RustRover, coverage tools, Miri, Criterion benchmarks, cargo-mutants and JUnit XML output.

How it compares: cargo test is built in and also runs doctests, which nextest does not yet run (teams typically run cargo test --doc separately). Nextest is a drop-in replacement for most other tests, configured through .config/nextest.toml with named profiles, for example a ci profile with retries and JUnit output.

In the quality loop, nextest speeds up unit and integration test runs locally and in CI, and its retries, flaky-test reporting and sharding make it a strong foundation for Rust release gates.

The source code is at nextest-rs/nextest on GitHub under the Apache-2.0 licence, with about 3,400 stars; the most recent commit was on 8 November 2026.

Features

  1. Process per test: Isolates crashes, global state and hangs, and enables reliable timeouts.
  2. Faster scheduling: Runs tests across all test binaries in parallel; the site cites up to 3x speed-ups.
  3. Retries and flaky detection: Retry failing tests and report which ones passed only on retry.
  4. Filtersets: A DSL such as -E 'package(core) and test(/parse/)' selects exactly which tests run.
  5. Profiles: Named configurations in .config/nextest.toml, for example separate local and CI settings.
  6. Partitioning and archives: Shard runs across CI machines and reuse builds on other machines.
  7. Timeouts and slow tests: Warn about slow tests and terminate hung ones.
  8. Machine-readable output: JUnit XML and other formats for CI dashboards.

Pros

  1. Better CI ergonomics: Retries, sharding and JUnit output are built in.
  2. Drop-in adoption: Most projects can switch with cargo nextest run and no code changes.
  3. Free to use: Open source under the Apache-2.0 licence, so the core tool costs nothing to use.
  4. Actively maintained: The repository had commits as recent as 8 November 2026.
  5. Community: About 3,400 GitHub stars.

Cons

  1. No doctests: Doctests still need cargo test --doc.
  2. Process overhead: Spawning a process per test adds overhead for suites of extremely tiny tests (usually outweighed by better parallelism).
  3. Extra tool to install: CI images need the nextest binary.
  4. Shared-state assumptions: Tests that rely on running in the same process (for example shared in-memory singletons) need adjustment.

Install a pre-built binary (see the docs for your platform) or via Cargo, then run tests:

cargo install cargo-nextest --locked
cargo nextest run

Select tests with a filterset and re-run failures:

cargo nextest run -E 'package(billing) & test(/invoice/)'
cargo nextest run --no-fail-fast

A CI profile with retries, timeouts and JUnit output in .config/nextest.toml:

[profile.ci]
retries = 2
fail-fast = false
slow-timeout = { period = "60s", terminate-after = 3 }

[profile.ci.junit]
path = "junit.xml"
cargo nextest run --profile ci --partition count:1/4
cargo test --doc   # doctests still run with cargo test

Practical tips:

  1. Track tests that only pass on retry and fix them, rather than raising retry counts.
  2. Use partitioning to split long suites across parallel CI jobs.
  3. Combine with cargo-llvm-cov for coverage; it has documented nextest support.

Resources:

Pricing

cargo-nextest is free and open source under the Apache-2.0 licence.

  1. Rust teams with large workspaces or slow test suites.
  2. CI owners who need retries, sharding and JUnit reports.
  3. Projects with flaky or hanging tests that benefit from isolation and timeouts.
  4. Not a fit on its own for doctests, which still need cargo test --doc.

Conclusion

cargo-nextest has become the standard upgrade over cargo test for serious Rust projects, thanks to process isolation, faster scheduling and excellent CI features.

Adopt it with a CI profile, keep running doctests separately, and you get quicker, more reliable Rust test runs.

Compare

CheckOps pages that put cargo-nextest next to related tools. There is no paid placement on these lists.

Alternatives

Other tools on CheckOps that cover similar ground. Open a page, or compare one with cargo-nextest side by side.