Skip to main content

flakestat

Documentation


Find flaky tests in any language. No SaaS, no account, no data leaving your machine.

A flaky test passes and fails randomly on the same code. flakestat tells you exactly which ones, ranked worst first.

flakestat hunt --runs 20 \
  --junit 'reports/junit-{run}.xml' \
  -- pytest -q --junitxml='reports/junit-{run}.xml'
VERDICT               SCORE  RUNS  PASS/FAIL  TEST
flaky                  0.62    20       14/6  tests.test_auth::test_refresh_token
consistently-failing   0.00    20       0/20  tests.test_billing::test_discount

1 flaky, 0 suspect, 1 consistently failing, 1 stable, 1 unscored (of 4 tests)

Install

pip install flakestat

This package downloads the prebuilt flakestat binary for your platform (macOS, Linux, Windows on x86_64/arm64) from GitHub Releases on first use. It has no Python dependencies, so it cannot interfere with your project's resolution.

Why the verdicts matter

Flakiness is inconsistency, not failure. A test that fails 100% of the time scores 1.0 on failure rate but isn't flaky. It's broken. flakestat scores state transitions (pass→fail→pass), so an always-failing test correctly scores zero and is reported separately as consistently-failing instead of being mixed in with real flakes.

Skipped tests are excluded rather than treated as passes, so @pytest.mark.skip never manufactures a phantom transition.

How it compares

pytest-rerunfailures and pytest-flakefinder retry tests so a run goes green. That hides the symptom. flakestat measures which tests are unreliable and by how much, so they can be fixed, and it works across every suite in a polyglot repo, not just the Python one.

Tracking over time

A burst proves flakiness exists. History measures it, and catches environment-dependent flakes a local burst never will.

flakestat ingest 'reports/**/*.xml'   # in CI, after tests
flakestat report --top 20
flakestat report --fail-on-flaky      # exit 1 to gate a pipeline

History lives in .flakestat/runs.ndjson, one JSON object per line. Commit it for shared team history, or keep it as a CI artifact.

Working out why a test is flaky

flakestat explain test_checkout_timeout

Shows the evidence behind a verdict: pass/fail counts, how often the outcome changed, how much of that happened on identical code, and a history strip (P P F P P F) marking each flip. --json emits the same for tooling.

Every verdict also carries a confidence level, because 0.41 from three runs and 0.41 from three hundred are different claims.

Environment variables

Variable Effect
FLAKESTAT_BINARY Use this binary instead of downloading
FLAKESTAT_SKIP_DOWNLOAD Fail instead of downloading
FLAKESTAT_CACHE_DIR Where the binary is cached

Full documentation

https://flakestat.com/docs/ covers install, CI recipes, every command and flag, and how the scoring works. Source and issues: https://github.com/rowhitswami/flakestat

MIT

Release files for flakestat 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for flakestat 0.2.1
File Size Uploaded
flakestat-0.2.1.tar.gz 6.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for flakestat 0.2.1
File Interpreter ABI Platform
flakestat-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 13.3 kB

Release files / flakestat-0.2.1.tar.gz

Download URL flakestat-0.2.1.tar.gz
Size 6.3 kB
Tags Source
SHA-256 checksum
How to use checksums
74639e25dd412798c63242555300256efb1015d19e38b4d3c9478d5d5bbb0afd
BLAKE2b-256 checksum
How to use checksums
f106c65af6c4ebb729e88fe5b4461aa3f48479340f0e8d421fafc49e0e6a33c0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 8, 2026.

Transparency log

Release files / flakestat-0.2.1-py3-none-any.whl

Download URL flakestat-0.2.1-py3-none-any.whl
Size 7.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0e4ec84fa92d5ce65b95054323f172b812499fce74382007e9dff8eefde0f72d
BLAKE2b-256 checksum
How to use checksums
6097edb683b3a26a200e64fad5d83470c0ce2385914e43a5114930b43d95b9d3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 8, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files

0.2.0

2 release files

0.1.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page