Diagnose flaky test
diagnose-flakyRepeats failing Playwright tests with retries disabled to diagnose flakiness and return per-test evidence-based verdicts: consistently failing, flaky, or not reproducing.
Instructions
Repeat failing tests (Playwright or pytest-playwright) with retries disabled and return a per-test, evidence-based verdict: CONSISTENTLY FAILING (real bug), FLAKY (pass/fail counts, error-signature variance, duration spread) or NOT REPRODUCING. Runs all repetitions in one process by default. isolate: true also re-runs the failures with one worker to tell parallelism bugs (shared state) from flakiness inside the test; order: true (Playwright 1.64+) runs the files in random orders to catch tests that depend on what ran before them. Defaults to the tests that failed in the most recent run.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "diagnose-flaky"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| runs | No | How many times to run the tests (default 3) | |
| order | No | Also run the target files in `runs` random orders (Playwright 1.64+ --shuffle, one worker) to find tests that depend on what ran before them; returns the seed that reproduces it and the likely culprit test | |
| config | No | playwright.config path or 1-based index when the project has several configs | |
| headed | No | Run with a visible browser window | |
| browser | No | Playwright project name to run | |
| isolate | No | Also tell parallelism bugs from real flakiness: repeat in parallel (fully parallel, `workers` default 4), then repeat the failing tests with one worker | |
| workers | No | ||
| testFiles | No | Tests to diagnose ("file:line" supported). Defaults to the tests that failed in the most recent run. | |
| timeoutMs | No | Hard wall-clock limit per run (default 120000); one --repeat-each process gets this × runs | |
| projectRoot | No | Project directory; defaults to the server working directory | |
| separateProcesses | No | Start a fresh Playwright process per run instead of one --repeat-each process (slower; use when the flake depends on global setup or a cold start) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | false when the call failed (see error) or the tests it ran failed | |
| error | No | ||
| tests | No | ||
| verdict | No |