Repository navigation
ci(ios): boot the Detox simulator before the build so its first boot doesn't starve the tests - #4444
Merged
Merged
Conversation
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-loadedis 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,CLLocationManagerinit and StoreKit storefront take about 76 s, and Mapbox reportsBillingServiceWorker::constructor93 s,TileStoreWorkerHolder::constructor100 s andConfigurationServiceWorker::constructor108 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 installand the Xcode build (about 14 min) instead of with the tests. Detox reuses the booted device throughDETOX_DEVICE_UDID. After the build, the job waits forbootstatusand 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
CONTRIBUTING.mdyarn generatein the root folder/exampleapp.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.