Repository navigation
ci: wait for the test simulator before running xcodebuild - #557
Merged
Merged
Conversation
On a fresh runner CoreSimulator can still be enumerating its devices when
the test step starts. xcodebuild then fails to resolve
`-destination ...,name=iPhone 16 Pro` ("Unable to find a device matching
the provided destination specifier", exit code 70) and the retry action
spends its second attempt on what was only a startup race.
A new step runs scripts/wait-for-simulator.sh, which polls
`xcrun simctl list devices available` until a device with that name is
listed (180 s by default) and otherwise fails with the device list in the
log.
Pre-merge checks:
|
On the first CI run with the wait step, the ASan runner listed the simulator only after 125 s, too close to the 180 s default.
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.
The Test and Test (ASan) jobs sometimes burn their first "Xcode Tests" attempt in about a minute, without building anything:
On a fresh runner, CoreSimulator can still be enumerating its devices when the step starts, so the destination doesn't resolve yet. The retry, about 50 s later, finds the device and passes. This happened on both test jobs of #547 and on the ASan job of
feat/ios-stdio-forwarding, so it isn't tied to any one change.Change
scripts/wait-for-simulator.sh --name <device> [--timeout <s>]pollsxcrun simctl list devices availableuntil an iOS device with that name is listed. A failingsimctlcall while CoreSimulator starts counts as "not yet". After the timeout (300 s by default) it fails with an::error::annotation and the device list.-destination.It doesn't pre-boot the simulator. That would compete with the build on the runner's few cores, and the race is only about the device being listed.
Testing
--name, a non-numeric--timeoutand unknown flags.--flag valueand--flag=valueforms work.