serial_test

Run Rust tests serially with #[serial] and #[file_serial] attributes.

3|Updated Jan 10, 2026
One-click install
npx skills add https://github.com/yankeeinlondon/rusty-biscuit --skill serial-test
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: serial_test
Source: https://github.com/yankeeinlondon/rusty-biscuit/tree/main/.claude/skills/serial_test
Command: npx skills add https://github.com/yankeeinlondon/rusty-biscuit --skill serial-test

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Test isolation for Rust tests that share global state (environment variables, files, singletons) to prevent flaky tests and ensure deterministic runs.

Core Features & Use Cases

  • Serial test execution within a single process using #[serial].
  • Named groups support with #[serial(group)] for fine-grained isolation.
  • File-based cross-process isolation via #[file_serial] with the optional file_locks feature.
  • Async test compatibility and integration with existing test runners.
  • Clear guidance on using test runners like cargo test and nextest.

Quick Start

Annotate tests with #[serial] to run them one at a time within a single process, or use #[file_serial] for cross‑process isolation, then run cargo test as usual.

Frequently Asked Questions about serial_test

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I isolate Rust tests that share global state like environment variables or singletons?

Isolating Rust tests that share global state requires serial test execution to prevent cross-test interference. Annotating tests with #[serial] runs them sequentially within a single process, ensuring deterministic builds and eliminating flaky test results caused by shared environment variables, files, or singletons.

How do I prevent cross-process interference during concurrent Rust test runs?

Preventing cross-process interference during concurrent Rust test runs requires file-based locking. Using the optional file_locks feature with #[file_serial] provides cross-process isolation, ensuring deterministic execution when running tests across multiple processes or crates.

Does serial test isolation work with the nextest test runner in Rust?

Serial test isolation works with both cargo test and nextest test runners. It integrates with existing test runners to provide isolated test execution, supporting both unit and integration tests across crates without requiring workflow changes for deterministic builds.

Can I group specific Rust tests to run in isolation while others run in parallel?

Grouping specific Rust tests for isolation while others run in parallel is supported through named groups. Using #[serial(group)] provides fine-grained isolation control, allowing distinct test groups to execute serially while ungrouped tests run concurrently.

When should I use file-based locking instead of in-process serial test execution?

File-based locking via #[file_serial] is necessary when tests run across multiple processes or crates that share files or environment variables. In-process #[serial] execution suffices for single-process isolation, preventing interference from shared singletons or variables.