Skip to content

ci(ios): capture diagnostics when a Detox e2e test fails - #4418

Merged
mfazekas merged 1 commit into
mainfrom
ci/ios-detox-diagnostics
Oct 27, 2026
Merged

mfazekas merged 1 commit into
mainfrom
ci/ios-detox-diagnostics

Conversation

@mfazekas

@mfazekas mfazekas commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Description

The iOS Detox job has failed 5 times out of 94 runs since e2e tests were turned on in #4379, and every PR retry passed. Two kinds of failure showed up in the existing artifacts:

  1. Launch hang (docs(example): add snackSupported example metadata #4416, run 40483343548). The app connected to Detox at 10:08:14, but the host-side xcrun simctl get_app_container call inside launchApp took 2 min 4 s. That ran past the 120 s beforeAll timeout. The "busy main queue / bundle load / localhost:8081/status" messages that followed came from afterEach's reloadReactNative racing the launch that was still running. Metro isn't used: the Debug build embeds the bundle, and the 8081/8097 probes are refused within milliseconds.
  2. Map never loads (docs: state minimum Mapbox Maps SDK version in install docs #4415 and 2 runs on main). In run 40464001655 the streets-v12 style request never got a connection to api.mapbox.com and timed out after 30 s three times in a row, with nothing sent. In the other runs the runner was just very slow: TLS connects took 7–8 s, or the first Mapbox request started 90 s into the test.

Both look like runner or network conditions rather than an app bug, so this PR adds no fix, only diagnostics for the next failure:

  • example/e2e/environment.js wraps Detox's Jest environment. On CI, when a test or hook fails, it captures ps (shows a stuck simctl/applesimutils call and any CPU hogs), vm_stat, the booted simulators, and a curl connect/TLS timing to api.mapbox.com, while the app is still in the failing state. It stops after 3 captures per file and does nothing on the passing path.
  • After a failed run, the workflow also collects RNMapboxExample crash reports, the app/SpringBoard simulator log, the host CoreSimulator/simctl log and the load average. It also turns on --capture-view-hierarchy (failures only).
  • Everything ends up in the detox-artifacts-attempt-<n> artifact under diagnostics/, kept for 14 days, next to Detox's existing logs, screenshots and device logs.

I checked this with a temporary failing assertion (since removed); see run 40520078616. Sampling the app's main thread with sample (with sudo) attached but captured no stacks for the simulator process, so it isn't included.

Checklist

  • I've read CONTRIBUTING.md
  • I updated the doc/other generated code with running yarn generate in the root folder
  • I have tested the new feature on /example app.
    • In V11 mode/ios
    • In New Architecture mode/ios
    • In V11 mode/android
    • In New Architecture mode/android
  • I added/updated a sample - if a new feature was implemented (/example)

@mfazekas
mfazekas force-pushed the ci/ios-detox-diagnostics branch 2 times, most recently from 3da3008 to ee82e79 Compare October 27, 2026 13:24
@mfazekas
mfazekas force-pushed the ci/ios-detox-diagnostics branch from ee82e79 to 40080b7 Compare October 27, 2026 13:48
@mfazekas
mfazekas force-pushed the ci/ios-detox-diagnostics branch from 40080b7 to 96b3018 Compare October 27, 2026 14:19
When a test or hook fails, capture host processes, memory, the booted simulators and
a connect/TLS probe to api.mapbox.com while the app is still in the failing state.
After a failed run, also collect crash reports and the simulator and CoreSimulator logs,
capture the view hierarchy on failure, and keep the artifacts per attempt for 14 days.
@mfazekas
mfazekas force-pushed the ci/ios-detox-diagnostics branch from 96b3018 to 0da3a23 Compare October 27, 2026 14:49
@mfazekas
mfazekas marked this pull request as ready for review October 27, 2026 15:22
@mfazekas
mfazekas merged commit 7a73d62 into main Oct 27, 2026
10 checks passed
@mfazekas
mfazekas deleted the ci/ios-detox-diagnostics branch October 27, 2026 15:47
@mfazekas mfazekas mentioned this pull request Oct 27, 2026
4 of 8 tasks

This branch was previously deployed

1 inactive deployment
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.

1 participant