flakeradar 🎯
Flaky-test radar for pytest. Tracks per-test flake rate across runs and writes a
FLAKY.md leaderboard your CI commits back — so flaky tests are named, ranked, and
impossible to ignore.
- Zero dependencies beyond pytest. Pure stdlib.
- History is a plain JSONL file (
.flakeradar/history.jsonl) you commit to the repo — that's what makes "across runs" work on stateless CI runners. - Scores flakiness, not failure: a test that always fails scores 0 (it's broken, not flaky). A test that alternates pass/fail scores near 1.
Install
pip install pytest-flakeradar
Use
pytest --flakeradar
Every run appends one record to .flakeradar/history.jsonl, rescores the window, and
rewrites FLAKY.md:
| # | Test | Flake score | Recoveries | Flips | Fail / Pass | Last outcome |
|---|---|---|---|---|---|---|
| 1 | tests/test_api.py::test_ws_reconnect |
0.75 | 1 | 2 | 2 / 2 | passed |
Flake score = (intra-run recoveries + inter-run flips) / runs seen, over the last
--flakeradar-window runs (default 50).
- Recovery: failed then passed within one run (e.g. pytest-rerunfailures retries). The strongest flake evidence there is.
- Flip: final outcome changed between consecutive runs.
Options
| Flag | Default | |
|---|---|---|
--flakeradar |
off | enable recording + leaderboard |
--flakeradar-dir |
.flakeradar |
history directory (relative to rootdir) |
--flakeradar-md |
FLAKY.md |
leaderboard path; "" disables |
--flakeradar-window |
50 |
runs to score over |
--flakeradar-keep |
200 |
max runs kept in history |
--flakeradar-top |
20 |
max leaderboard rows |
--flakeradar-fail-above SCORE |
off | exit non-zero if any score ≥ SCORE (CI gate) |
CLI (no pytest run needed)
flakeradar report # print the leaderboard
flakeradar md --out FLAKY.md # regenerate the markdown
CI setup (the commit-back loop)
The runner is stateless, so persist history by committing it back. GitHub Actions:
see examples/github-actions.yml — run pytest with
--flakeradar, then commit .flakeradar/history.jsonl + FLAKY.md with
[skip ci]. GitLab and Buildkite equivalents live in examples/ too.
Prefer not to commit? Restore/save .flakeradar/ with your CI cache instead — the
leaderboard still works, it's just not visible in the repo.
CI providers
flakeradar stamps each run with provider metadata (run id/URL/branch/commit), detected from environment variables. Built-in adapters: GitHub Actions, GitLab CI, Buildkite, CircleCI, Jenkins, with a local fallback.
Your provider missing? That's a ~20-line PR. See
CONTRIBUTING.md — one small class with detect(env) and
run_meta(env). Third-party packages can also register adapters via the
flakeradar.adapters entry-point group without touching this repo.
License
MIT © Sophie Nguyen (Nguyễn Thu Thuỷ)
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pytest_flakeradar-0.1.0.tar.gz.
File metadata
- Download URL: pytest_flakeradar-0.1.0.tar.gz
- Upload date:
- Size: 13.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
32c9b5c168b4b384838f149c123fc5edb07a6318b2757f8bb4e2e8d8f5e8e297
|
|
| MD5 |
130941fec896db29b77ec04d1daabc10
|
|
| BLAKE2b-256 |
e90484bac281de0cba35884f9ea344bccfc425ee901cbc6e9d2f123d113f5a86
|
Provenance
The following attestation bundles were made for pytest_flakeradar-0.1.0.tar.gz:
Publisher:
release.yml on sophie-nguyenthuthuy/flakeradar
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pytest_flakeradar-0.1.0.tar.gz -
Subject digest:
32c9b5c168b4b384838f149c123fc5edb07a6318b2757f8bb4e2e8d8f5e8e297 - Sigstore transparency entry: 2388020671
- Sigstore integration time:
-
Permalink:
sophie-nguyenthuthuy/flakeradar@c9c00a03e66ec0cf62b935632f2bd75a871a7fba -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/sophie-nguyenthuthuy
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@c9c00a03e66ec0cf62b935632f2bd75a871a7fba -
Trigger Event:
push
-
Statement type:
File details
Details for the file pytest_flakeradar-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pytest_flakeradar-0.1.0-py3-none-any.whl
- Upload date:
- Size: 12.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
95036488977c2e0e6affbe3db6f2f53b8f281cee22b23e0848251ab8fa2f2e64
|
|
| MD5 |
bbd6258b5350c8214b34fc187dab6e42
|
|
| BLAKE2b-256 |
ee4dc897fa6ee76cbcc0361b3f497406e520dc1c1f6b146c8974c2037c5d5fb1
|
Provenance
The following attestation bundles were made for pytest_flakeradar-0.1.0-py3-none-any.whl:
Publisher:
release.yml on sophie-nguyenthuthuy/flakeradar
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pytest_flakeradar-0.1.0-py3-none-any.whl -
Subject digest:
95036488977c2e0e6affbe3db6f2f53b8f281cee22b23e0848251ab8fa2f2e64 - Sigstore transparency entry: 2388020689
- Sigstore integration time:
-
Permalink:
sophie-nguyenthuthuy/flakeradar@c9c00a03e66ec0cf62b935632f2bd75a871a7fba -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/sophie-nguyenthuthuy
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@c9c00a03e66ec0cf62b935632f2bd75a871a7fba -
Trigger Event:
push
-
Statement type: