Skip to content

ci(ios): boot the Detox simulator before the build so its first boot doesn't starve the tests - #4444

Merged
mfazekas merged 3 commits into
mainfrom
fix/ios-e2e-map-loaded-flake
Nov 9, 2026
Merged

mfazekas merged 3 commits into
mainfrom
fix/ios-e2e-map-loaded-flake

Conversation

@mfazekas

@mfazekas mfazekas commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Description

Fixes the iOS Detox flake in "should finish loading a map" (failed in https://github.com/rnmapbox/maps/actions/runs/42461701178/job/128672729873 and https://github.com/rnmapbox/maps/actions/runs/42175378821/job/127753342574).

The map does load. In both failure screenshots e2e-map-loaded is on screen, but only after 90–110 s. The simulator is booted right before the tests. It is still doing first-boot work (around 250 simulator processes: PosterBoard and poster extensions, widget extensions, chronod, spotlight), and the 3-CPU runner is swapping. The failure diagnostics show a load average of 105 and 274, with about 70 MB free. The first map creation in the app waits on system daemons that are starved by this. In the device logs, CLLocationManager init and StoreKit storefront take about 76 s, and Mapbox reports BillingServiceWorker::constructor 93 s, TileStoreWorkerHolder::constructor 100 s and ConfigurationServiceWorker::constructor 108 s, where passing runs take 1–3 s. Passing runs show the same pattern in milder form: this test took 115 s and 46 s in two of the last six green runs, against 13–27 s in the others.

This boots the Detox simulator right after checkout, so its first-boot work overlaps with pod install and the Xcode build (about 14 min) instead of with the tests. Detox reuses the booted device through DETOX_DEVICE_UDID. After the build, the job waits for bootstatus and logs one load and free memory snapshot.

A wait for the load to drop doesn't help. Even after 25 minutes, a booted iOS 26.5 simulator keeps this runner at a load of 60–140 with about 60–360 MB free. In three runs with the early boot, "should finish loading a map" passed in 15, 16 and 20 s.

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.

Component to reproduce the issue you're fixing

Not reproducible locally: it needs a freshly booted simulator on a small runner. Evidence is from the Detox artifacts of the two failed runs (detox-artifacts-attempt-1: device.log, diagnostics/*/ps.txt, vm_stat.txt, uptime.txt). Verified with three CI runs of this PR's iOS job: 14.9 s, 16.3 s and 20.2 s for that test.

@mfazekas mfazekas changed the title ci(ios): wait for the freshly booted simulator to settle before Detox tests ci(ios): boot the Detox simulator before the build so its first boot doesn't starve the tests Nov 8, 2026
@mfazekas
mfazekas merged commit 6201b6b into main Nov 9, 2026
10 checks passed
@mfazekas
mfazekas deleted the fix/ios-e2e-map-loaded-flake branch November 9, 2026 05:49

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