flaky-hunter

Diagnose and fix tests that pass sometimes and fail other times. Use when CI is red intermittently.

archive228/loopkit19 installsMITSynced Aug 22

Works with

Claude CodeCursorCodex CLIGitHub CopilotGemini CLI
---
name: flaky-hunter
description: Diagnose and fix tests that pass sometimes and fail other times. Use when CI is red intermittently.
license: MIT
---

# Flaky Test Hunter
Run the suspect test 20x in a loop first — confirm it's actually flaky, not just broken.
Common causes, in order of likelihood:
1. **Time/order** — depends on test execution order or shared mutable state. Isolate it; run alone.
2. **Async race** — asserting before a promise/refetch resolves. Await the actual condition, not a sleep.
3. **Real network/clock/random** — mock them. Freeze time, seed RNG, stub the call.
4. **Resource leak** — a prior test left a connection/file/port open.
Fix the cause, not the symptom. `retry(3)` on a flaky test hides a real race that will bite in production. Quarantine only as a last resort, with a ticket.

More Debugging skills

← All Debugging skills

Check your AI visibility

One URL in, a 0–100 score and the exact fixes out.

RUN THE CHECK

Browse all the tools

15 tools across six categories
13 of them never send your data anywhere

Free · No signup · No trial clock

SEE THE DIRECTORY