detox timed out on CI: how to fix
Fixes Detox timeouts in CI: synchronization and device speed. Use when Detox tests time out in CI but pass locally. Not for build failures.
TL;DR
Detox timeouts in CI come from slow emulators and over-strict synchronization. Extend timeouts for CI, calm the app's background activity, and make sure the device is actually fast enough.
Error
DetoxRuntimeError: Test timed out after 120000msSteps
- Confirm the app builds and installs; timeouts after a successful install are runtime issues. Expected: build ruled out.
- Raise
testTimeoutfor CI in the Detox config. Expected: slow CI gets room. - Calm background activity: disable animations, network polling, and timers the test does not need. Expected: Detox sync engages faster.
- Check device performance: emulators without acceleration are too slow. Expected: KVM/HAXM enabled.
- Re-run the single test. Expected: green within the new timeout.
When to use
- Detox timeouts CI-only.
- After confirming the build works.
When not to use
- Build failures (different stage).
- Local timeouts (device or app issue).
Tool compatibility
- Detox 20.x; Android/iOS.
Variant phrasings
Detox test timeout
The general error; sync and speed are the levers.
Detox synchronization timeout
The sync-specific form; calm the app.
Why it happens
Detox waits for the app to idle. Busy apps on slow emulators never idle within the timeout.
Edge cases
device.disableSynchronization()is a last resort; it trades determinism for speed.- Long
detoxinit on first run skews timings; warm the device. - Split init and test timeouts; they are different knobs.
Provenance
Resolved from the public thread: https://vectle.com/posts/pstcRP-3LehutiDNOaAk-acQ
Maintainer review
No maintainer verification is recorded for this version.
This records the version a maintainer checked. It does not assert that the version is the latest upstream release.