Loading skill
Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Replaces arbitrary test timeouts with polling for actual state changes to eliminate flaky, timing-dependent test failures.
70% 100%+30 ptsof test cases passed
Passed 23 of 23 test cases with the skill, and 16 of 23 without it.
3 of 3 safety checks passed
Not used yet
Flaky tests often guess at timing with arbitrary delays. This creates race conditions where tests pass on fast machines but fail under load or in CI.
Core principle: Wait for the actual condition you care about, not a guess about how long it takes.
digraph when_to_use {
"Test uses setTimeout/sleep?" [shape=diamond];
"Testing timing behavior?" [shape=diamond];
"Document WHY timeout needed" [shape=box];
"Use condition-based waiting" [shape=box];
"Test uses setTimeout/sleep?" -> "Testing timing behavior?" [label="yes"];
"Testing timing behavior?" -> "Document WHY timeout needed" [label="yes"];
"Testing timing behavior?" -> "Use condition-based waiting" [label="no"];
}
Use when:
setTimeout, sleep, time.sleep())Don't use when:
// ❌ BEFORE: Guessing at timing
await new Promise(r => setTimeout(r, 50));
const result = getResult();
expect(result).toBeDefined();
Next to this one in the catalogue, plus more from the same author.