# Reducing Flaky E2E Tests in Expo Apps

A green CI badge means nothing if engineers rerun the pipeline until luck strikes. Flaky mobile E2E is a product risk signal, not a nuisance ticket.

Published: 2026-10-20

## Flaky E2E is a trust problem

Animation races, Metro reload timing, and real network dependencies turn mobile E2E into a lottery. Teams that 'just retry' teach themselves to ignore red builds until a release is blocked.

Staff engineers track flake rate like error budget: visible, owned, and trending down. Reliability of the test system is part of shipping confidence for Expo products.

Treat the suite as product infrastructure: when flakes exceed a threshold, freeze feature work on new specs until ownership and root-cause tickets exist.

## Wait on contracts, not clocks

Use fixed test accounts, seeded data, and known API responses. Stub HTTP at the client boundary when the goal is UI flow, not backend integration—reserve a smaller integration suite for cross-service truth.

Replace arbitrary sleeps with visibility and network idle predicates from your runner. If a test needs a five-second sleep, it is documenting a missing synchronization contract.

Record video and network HAR on failure once, not on every retry—artifacts should explain the flake, not recreate it probabilistically.

- Reset app state and server fixtures deterministically between specs
- Stub network at the boundary; avoid sleeping on animations
- Quarantine flaky tests with owner and SLA, do not mute forever
- Run a subset on every PR, full matrix nightly on real devices

## Quarantine with discipline

Move flaky specs to a quarantine job with an owner and fix-by date. Unlimited retries in the main pipeline hide debt and burn CI minutes.

When a quarantined test fails consistently, that is progress—it is now deterministic enough to debug.

Review quarantine weekly with release managers; items past SLA should block the train or force deletion of the spec.

## Layer CI realistically

Run a fast smoke suite on every pull request; run the full device matrix nightly or pre-release. Emulators catch logic; real devices catch keyboard, push permissions, and native module edge cases.

Reducing flake is how Expo teams keep shipping weekly without pretending mobile is just small web.

Publish flake rate beside build time so product feels the cost of ignoring mobile CI health.

## Make reliability visible

Pick one flake metric, one quarantine SLA, and one real-device tier to improve this sprint—then ask release managers whether confidence actually moved.

Staff ownership turns E2E from a lottery into an instrument the team trusts when shipping Expo apps weekly.
