Skip to content

Add --maxfail option to stop after N failures #71

@renaudcepre

Description

@renaudcepre

Feature Request

Add a --maxfail=N option (similar to pytest) to stop test execution after N failures/errors.

Current behavior

  • -x / --exitfirst: stops after the first failure

Proposed behavior

  • --maxfail=N: stops after N failures/errors
  • -x would be equivalent to --maxfail=1

Use cases

  • CI pipelines: fail fast but allow a few flaky tests
  • Large test suites: don't wait for 1000 failures when 10 is enough to know something is broken
  • Memory optimization: fewer failures stored in reporter lists

Implementation notes

  • Modify ParallelExecutor to check failure count against threshold
  • Add CLI argument in protest/cli/main.py
  • Update _ParallelExecutionState to track failure count (already done with counts)

Priority

Low - nice to have

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions