Flaky Test

Random Content Load Delay

Data loading takes a random amount of time (0-15 seconds) per click, causing tests with fixed timeouts to fail intermittently.

Data Loader

Click "Load Data" to fetch results. Each click uses a random delay between 0 and 15 seconds. A test with a fixed 5-second timeout would pass sometimes and fail other times.

Last delay: --

No data loaded yet

Click "Load Data" to simulate a data fetch with random latency

Load History

Each load attempt is recorded below with its random delay duration.

No loads recorded yet.

Why This Causes Flaky Tests

Tests that use fixed timeouts (e.g., await page.waitForTimeout(5000)) will pass when the random delay is under 5s but fail when it exceeds 5s. This simulates real-world network latency variability.

  • Delay is randomized between 0ms and 15,000ms on each click
  • A test with waitForTimeout(5000) fails ~67% of the time
  • Fix: Use element-based waits like waitForSelector instead of fixed timeouts