Skip to content

Glossary

This page defines key terms and identifiers used throughout nextest.

Run ID

A run ID is a UUID that uniquely identifies a single invocation of cargo nextest run. Every test and setup script executed within that run shares the same run ID.

Run IDs are useful for:

  • Correlating logs and events across tests within the same run.
  • Distinguishing between different test runs in external systems.

The run ID is available:

  • During cargo nextest run, at the beginning of the test run. For example:

     Nextest run ID 1f79aa0d-4ec8-4a5c-aa83-5e8dc2f36573 with nextest profile: default
        Starting 14 tests across 3 binaries (177 tests skipped)
    ...
    
  • Via the NEXTEST_RUN_ID environment variable.
  • In JUnit output, via the uuid attribute on the root testsuites element.
  • 0.9.108 In USDT probes, through arg1 for run-* events, and also JSON-encoded in arg0 as the run_id field.

Binary ID

A binary ID uniquely identifies a test binary within a Cargo workspace. The format depends on the type of binary:

Binary type Format Example
Unit test (from lib.rs) crate-name my-crate
Integration test crate-name::bin-name my-crate::integration
Other (benchmark, example, etc.) crate-name::kind/bin-name my-crate::bench/perf

For more about unit and integration tests, see the documentation for cargo test.

The binary ID is available:

  • During cargo nextest run, as the first part of each test execution line. For example:

            PASS [   0.014s] nextest-runner reporter::tests::on_test_finished_dont_store_final
                             ^^^^^^^^^^^^^^
                               binary id
    
  • In cargo nextest list output, as section headings. For example:

    nextest-runner: <-- binary id
        config::nextest_version::tests::test_valid_nextest_version::basic
        config::nextest_version::tests::test_valid_nextest_version::basic_with_patch
        ...
    
  • In JUnit output, via the name attribute on each testsuite element.

Within filtersets, binary IDs can be selected via the binary_id predicate.

Attempt ID

An attempt ID uniquely identifies a single execution attempt of a test. When tests are retried, each retry is a separate attempt with its own attempt ID. If you're collecting data by individual test execution, an attempt ID is a suitable, globally unique map key.

An attempt ID is comprised of:

  • The run ID
  • The binary ID
  • For stress tests, the 0-indexed stress index (not included if this is not a stress run)
  • The test name
  • The current attempt number, if the test is being retried (not included if this is the first attempt)

An example attempt ID is:

55459fda-13fe-406a-b4e3-0230fd52bb03:nextest_runner::integration@stress-3$basic::retry_overrides_ignored#2

Here:

  • 55459fda-13fe-406a-b4e3-0230fd52bb03 is the run ID.
  • nextest_runner::integration is the binary ID.
  • stress-3 is the stress index (the 4th stress iteration).
  • basic::retry_overrides_ignored is the test name.
  • 2 is the attempt number (indicating this is the 2nd attempt).

The attempt ID is available:

Slot numbers

0.9.90

Nextest assigns each running test a global slot number. Additionally, if a test is in a test group, the test is also assigned a group slot number.

Slot numbers are non-negative integers starting from 0. They are useful for assigning resources such as blocks of port numbers to tests.

Slot numbers are:

  • Unique for the lifetime of the test: no other concurrently running test will have the same global slot number, and no other concurrently running test in the same group will have the same group slot number.
  • Stable across retries within the same run (though not across runs).
  • Compact: each test is assigned the smallest available slot number at the time it starts. For example, if a test group is limited to serial execution, the group slot number is always 0.

The global slot number is available:

The group slot number is available:

  • Via the NEXTEST_TEST_GROUP_SLOT environment variable. (If a test is not within a group, NEXTEST_TEST_GROUP_SLOT is set to none.)
  • 0.9.108 In USDT probes, JSON-encoded in arg0 as the group_slot field. (If a test is not within a group, this is null.)