Skip to content

test(e2e): retry the iOS "Open React Native" tap and fail fast - #505

Merged
hurali97 merged 4 commits into
callstack:mainfrom
KisaneNeko:fix/ios-e2e-open-rn-retry
Oct 20, 2026
Merged

hurali97 merged 4 commits into
callstack:mainfrom
KisaneNeko:fix/ios-e2e-open-rn-retry

Conversation

@KisaneNeko

@KisaneNeko KisaneNeko commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Refs #498

Problem

iOS E2E tests (Expo 57, Expo 58 and Vanilla) sometimes hang for 12 minutes. In all 4 failed runs I checked, the XCUITest tap on "Open React Native" reached the app but the NavigationLink didn't push. The test then called device.enableSynchronization(), which never returned, because DetoxSync keeps the app busy on "React Native (bundle load)" until RN content appears.

Change

  • appleAppDetoxUtils.cjs (openReactNative): retry the tap up to 3 times within the existing timeout (10 s per attempt for Vanilla, 20 s for Expo). It only re-taps while the button is still visible, and the log says which case it was (re-tapping or button gone, still waiting).
  • appleAppDetoxUtils.cjs (openReactNative): re-enable synchronization only after RN is visible. If RN never shows up, the test fails after about a minute instead of hanging until the 720 s Jest timeout.

Verified

  • 2 normal CI runs on this branch: all iOS jobs passed. In the first, the retry kicked in on Expo 58 and Vanilla and both passed.
  • Forced lost taps in test(e2e): EXPERIMENT simulate lost iOS taps for #505 (do not merge) #506 (closed, never merged):
    • First tap skipped on Vanilla and Expo 58: every test logged re-tapping and passed (5/5 and 3/3).
    • Every tap skipped on Expo 57: each test failed after 67 to 82 s, without hitting the Jest timeout.

Not covered

Why the tap gets lost. The 4 lost taps were the slowest ones (55 to 106 s while the XCUITest runner started), but the logs don't show the cause.

On CI the XCUITest tap on "Open React Native" is sometimes delivered but
the NavigationLink doesn't push. The test then re-enabled Detox
synchronization in a finally block, and that call never returned:
DetoxSync keeps the app busy on "React Native (bundle load)" until RN
content appears. The test hung until the 720s Jest timeout.

Retry the tap (up to 3 attempts within the existing timeout, only while
the button is still visible) and only re-enable synchronization once RN
is visible.

Refs callstack#498
@KisaneNeko
KisaneNeko marked this pull request as ready for review October 19, 2026 11:46
KisaneNeko added a commit to KisaneNeko/react-native-brownfield that referenced this pull request Oct 19, 2026
@hurali97
hurali97 merged commit ecb5c3c into callstack:main Oct 20, 2026
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants