Flaky Test Playground
Flaky Test Playground
Probe randomized latency, intermittent failures, and UI race conditions.
Purpose
This playground concentrates on nondeterministic latency, intermittent failures, race conditions, and test anti-patterns that hide flakiness instead of fixing it.
Random delay playground
A healthy handler resolves within a deterministic, bounded time so tests can assert without arbitrary waits.
No request executed
Slowest run
—
Fastest run
—
Run history (newest first)
- No runs yet
Intermittent failure playground
A healthy endpoint succeeds every time; transient failures are retried transparently.
Last outcome: idle
runs: 0 · passed: 0 · failed: 0
Race condition playground
A healthy UI reflects the most recent intended value once async work settles.
UI state: idle
Stale value won: —
Transition timing playground
A healthy assertion waits for the element to reach its final settled state, not a mid-transition frame.
Early read (at click)
—
Settled read (after transition)
—
Session leak playground
A healthy demo resets to a clean, isolated state on every run regardless of execution order.
Runs this session
0
Leaked carryover (should stay 1)
0
Hard-sleep mask playground
A healthy test synchronizes on an observable condition, not a fixed sleep.
Work duration
—
Hard-sleep read (400ms)
—
Actual completion
—
Timing masked?
—
Silent retry playground
A healthy pipeline surfaces intermittent failures instead of silently re-running until green.
Silent retries
0
Total attempts
0
Reported outcome
idle
Known Intentional Issues (7)
Show hints (7)
Request handler resolves after a random 100-3000ms delay with no fixed timeout
Click the run button 20 times and assert the result text appears each time; a fixed sleep shorter than 3000ms will intermittently miss it
Endpoint fails roughly 30% of the time with no retry or idempotency guard
Run the request 30 times and assert a >=95% success rate; a single-shot assertion will flake about 1 in 3 runs
Race condition: a later-resolving promise overwrites the newer UI state
Trigger the race and after settle assert UI state equals the newer value, not older; without proper cancellation it ends on older
Test asserts on an animation/transition before it completes
Assert the loading label clears and final result is present using a polling/wait-for rather than a single synchronous read
Order-dependent state leaks between consecutive runs in the same session
Run the suite in two different orders and assert identical outcomes; a residual result string reveals leaked state
Hard-coded sleep masks a real timing bug instead of waiting on a condition
Replace any fixed setTimeout-based wait with an explicit wait-for-result assertion and confirm it still passes 20 of 20 runs
Retry logic hides intermittent failures by silently re-running until green
Disable retries and run the flaky-rate script (npm run test:e2e:flaky); assert the measured flake rate is reported rather than zero