Skip to content

Support --fail-fast across workers via file-based signal#499

Merged
MatthewMckee4 merged 5 commits intomainfrom
support-fail-fast-serial-mode
Feb 27, 2026
Merged

Support --fail-fast across workers via file-based signal#499
MatthewMckee4 merged 5 commits intomainfrom
support-fail-fast-serial-mode

Conversation

@MatthewMckee4
Copy link
Member

Summary

  • Workers now write a fail-fast signal file to the cache directory when --fail-fast is enabled and a test fails
  • The main process polls for this signal during its worker wait loop and kills remaining workers immediately when detected
  • Removes the "only works in parallel" limitation from --fail-fast docs

Test plan

  • Added test_failfast_across_files integration test verifying fail-fast stops across multiple test files
  • All 677 existing tests pass
  • Pre-commit checks pass

Closes #472

When `--fail-fast` is enabled, workers now write a signal file to the
cache directory upon encountering a test failure. The main process polls
for this file during its worker wait loop and kills remaining workers
immediately when detected, enabling fail-fast behavior across multiple
workers in parallel mode.

Closes #472
@MatthewMckee4 MatthewMckee4 added cli Related to the command-line interface test-running Related to running tests with karva labels Feb 27, 2026
@codspeed-hq
Copy link

codspeed-hq bot commented Feb 27, 2026

Merging this PR will degrade performance by 10.2%

⚠️ Unknown Walltime execution environment detected

Using the Walltime instrument on standard Hosted Runners will lead to inconsistent data.

For the most accurate results, we recommend using CodSpeed Macro Runners: bare-metal machines fine-tuned for performance measurement consistency.

❌ 1 (👁 1) regressed benchmark

Performance Changes

Mode Benchmark BASE HEAD Efficiency
👁 WallTime karva_benchmark 22.3 s 24.9 s -10.2%

Comparing support-fail-fast-serial-mode (b3c84fb) with main (15d45a9)

Open in CodSpeed

File ordering differs between macOS and Linux, making the cross-file
snapshot test non-deterministic. The existing single-file fail-fast
tests adequately cover the behavior.
@MatthewMckee4 MatthewMckee4 merged commit 777db22 into main Feb 27, 2026
9 checks passed
@MatthewMckee4 MatthewMckee4 deleted the support-fail-fast-serial-mode branch February 27, 2026 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli Related to the command-line interface test-running Related to running tests with karva

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support --fail-fast in serial mode

1 participant