Repository navigation
Skip the iOS simulator terminate right after boot and bound the others - #65
Merged
Merged
Conversation
bitsandfoxes
force-pushed
the
fix/ios-terminate-stall
branch
from
October 25, 2026 22:48
127a3f4 to
992e399
Compare
This was referenced Oct 26, 2026
bitsandfoxes
marked this pull request as ready for review
October 29, 2026 10:58
bitsandfoxes
requested review from
a team,
jpnurmi,
limbonaut and
tustanivsky
October 29, 2026 10:59
BootSimulator cleared FreshlyBooted before simctl boot, so a second boot of a simulator this provider just booted (Connect, then Start-Device) hit the already-Booted early return with the flag lost, and the first launch ran the simctl terminate the fresh-boot skip exists to avoid. Clear it only once the boot command has run.
The test got there by having the fake boot throw 'Unable to boot device in current state: Booted', but the real InvokeBuiltCommand throws an exit-code message, so production reaches an already-booted simulator through SelectAndConnect's booted branch. Connect by UUID to a simulator the fake lists as Booted instead, so that branch is covered.
BootSimulator matched simctl's 'Unable to boot device in current state: Booted' text, but InvokeBuiltCommand throws only 'Command (boot) failed with exit code N', so a second boot of a simulator this provider booted rethrew instead of keeping FreshlyBooted. Ask for the simulator state when boot fails and rethrow the boot error unless it is Booted, and have the test fake throw the exit-code message the real command throws.
bitsandfoxes
force-pushed
the
fix/adb-hung-launch
branch
from
October 29, 2026 11:07
bbca078 to
636c432
Compare
bitsandfoxes
force-pushed
the
fix/ios-terminate-stall
branch
from
October 29, 2026 11:07
85927bd to
07fa3b7
Compare
JoshuaMoelans
approved these changes
Oct 29, 2026
limbonaut
approved these changes
Oct 29, 2026
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 iOS simulator provider no longer runs
simctl terminatebefore the first launch after it boots the simulator, and every other terminate is bounded to 60 s. The first launch no longer stalls for minutes.In 150 sentry-unity Run iOS logs, the
simctl terminatebefore the first launch stalled for 59–430 s in 24 legs (16%), for example 349 s here. Later terminates never took more than 14 s, even when the app wasn't running. A first attempt waited forsimctl bootstatusbefore that terminate. In this run,bootstatusreturned within 1 s on all four legs, yet the first terminate still hung in one of them until the 60 s cap. So the stall isn't a boot that hasn't finished, and waiting for one doesn't help.How it works now:
BootSimulator()actually booted the device, the provider skips the terminate. On a freshly booted simulator, the app can't be running. The flag resets on every boot, restart and disconnect. A simulator that was already booted when the provider connected still gets the terminate.simctl terminateis bounded to 60 s, including the one after a run timeout. If the terminate before a launch times out, the launch adds--terminate-running-process, so every launch still starts a fresh process.Tests/iOSSimulatorRunApplication.Tests.ps1runs on macOS only. It uses a fakexcrunand runs the real start, restart and disconnect paths. It covers the skip after a boot, the re-arm after a restart, an already-booted simulator, a hung terminate and its fallback, and killing a hung command.Stacked on #64.
CI evidence: in sentry-unity run 40241909708 (getsentry/sentry-unity#2910, pinned to this commit), every Run iOS leg's first launch started 0 s after "Run log" and later launches within 1–5 s. No terminate timed out, and all 4 legs passed 57/57.
🤖 Generated with Claude Code