Repository navigation
fix(ios): fail fast when a session's simulator no longer exists - #4696
Conversation
A session keeps the booted fact from its open, so a runner restart after the simulator was deleted skipped every check and let xcodebuild wait out its 20 s destination timeout. The error then blamed the shared runner cache. Before the launch, one simctl listing confirms the simulator is still there, unless this process saw it booted moments ago. A missing simulator fails with DEVICE_NOT_FOUND naming its UDID.
|
Thanks for the fix. At bfbf250 the check itself looks right, but the wiring that fixes #4687 has no regression test, so I would add one before merge. All five tests in runner-simulator-presence.test.ts call Not blocking, and you can take or leave these: CI is green. The one check reported, and its |
The presence check had unit tests only, so removing its call from ensureBootedIfNeeded kept every test green. A runner-session readiness test now starts a runner for a booted simulator that the simctl listing omits and asserts DEVICE_NOT_FOUND with the udid, dispatched no, no cache-wiping hint, and no xcodebuild launch. The unit cases that duplicated it are dropped; the ones that must not refuse a start stay.
|
Thanks for the review. I pushed e213127 with the route-level regression test. The route test.
I put the test in It fails without the wiring. When I delete the Unit cases. I dropped "missing from the listing is refused" and "still listed passes", because the route test duplicates them. Three cases stay. Each one pins a start that must not be refused, and the route test does not reach these:
The memo test stays as long as the memo stays. Checks run locally: the apple-runner tests pass (983), lint passes, and the layering tests (483/483) and scan pass. Not done in this push: the non-blocking items. These are binding the platform-apple listing owner instead of re-parsing, dropping the memo, shrinking the comments, and asserting |
|
This is ready. At e213127 the route-level regression test through Not blocking: the header comment in The Smoke Tests run failed in the Android emulator keyboard step ( The PR body still lists the old head, file count and "new tests fail against base". The live-device numbers come from the earlier head and still apply, since this change is test-only. |
Summary
A session keeps
bootedfrom its open. After an external pool deletes the simulator, the next runner start skipped every check. xcodebuild then waited out its 20 s destination timeout and returnedCOMMAND_FAILEDwith a hint to delete the shared runner cache.The runner start now runs one
simctl list devices -jto confirm that a booted session simulator still exists. If it does not, the start fails withDEVICE_NOT_FOUND, names the UDID, and suggestsclose. The check follows the shape ofrefreshSessionDeviceIfNeededin the daemon and is loaded lazily. It is skipped when this process saw the simulator Booted moments ago (the existing booted memo). A listing that cannot be read never refuses a start (CONSERVATIVE:).6 files, +158/-6, 77 of them tests.
Fixes #4687.
Validation
Head
bfbf2503con baseaa600e980.check:quickpassed. apple-runner tests: 984 pass. The new tests fail against baserunner-session.ts.check:affected --run --head bfbf2503c(exactCommit): format, lint, typecheck, layering, fallow, build and vitest-related passed.unitfailed only intest/repo-guards/android-sdk-setup-action.test.ts(2 tests). They fail the same way onaa600e980on this host, where a local Android SDK path leaks into the expected path.open. Nextsnapshot -i: base took 23.3 s and returnedCOMMAND_FAILEDwith the cache hint. Head took 0.6–1.0 s and returnedDEVICE_NOT_FOUNDwithdetails.deviceId.closesucceeds.opentime is unchanged (12.4 s head, 12.7 s base).🤖 Generated with Claude Code
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.