Skip to main content

Why are E2E tests often flaky?

Reasons for E2E test instability:

  1. Dependency on external systems: a real API, database, network, or third-party services can respond slowly, with errors, or not respond at all.
  2. Asynchronous interface: elements appear with a delay, and the test clicks "too early."
  3. Fragile selectors: tests fail because of minor changes in the markup or text.
  4. Flakiness from timing: sleep, incorrect waits, differences between environments (local, CI).
  5. Lack of data isolation: leftover junk in the database, state from previous tests, races for resources.
  6. CI environment: a slow container, background load, browser instability in headless mode.

Summary: E2E tests are unstable because they depend on a large number of variables that the test has almost no control over.

Short Answer

Interview ready
Premium

A concise answer to help you respond confidently on this topic during an interview.