Diagnose and fix tests that pass sometimes and fail other times. Use when CI is red intermittently.
Installation
Installer avec Codex ou Claude Copiez ce prompt, collez-le dans Codex, Claude ou un autre assistant, puis laissez-le vérifier la page du skill et l'installer pour vous.
Diagnose and fix tests that pass sometimes and fail other times. Use when CI is red intermittently.
when_to_use
intermittent CI failure, "passes locally fails in CI", a flaky test
targets
["*"]
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:
Time/order - depends on test execution order or shared mutable state. Isolate it; run alone.
Async race - asserting before a promise/refetch resolves. Await the actual condition, not a sleep.
Real network/clock/random - mock them. Freeze time, seed RNG, stub the call.
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.