Repository navigation
Description
What happened
On a Mac under heavy load, simctl clone regularly takes longer than 30 s. Simlock cuts every simctl call off at a fixed 30 s, so on that Mac:
- Four warm-pool creations failed at the limit:
warm pool creation of a device failed … step: provision … DriverCrashError: simctl clone <seed udid> simlock-<id> ~/Library/Developer/CoreSimulator/Devices timed out after 30000ms - Four of five
simlock baseline savecalls failed the same way (BASELINE_SAVE_FAILED … simctl clone <device udid> simlock-baseline-<id> … timed out after 30000ms, each after 33 to 34 s). - Under
drivers.ios.deviceSet: "default", every creation that failed this way left onesimlock-<id>simulator in Xcode's device set. The copy finished after Simlock had stopped waiting, so the simulator has no mark and no registry record.simlock nuke --delete-devices --yesandsimlock doctor --purge-orphansdid not remove them. Five were left (about 6.3 GB) and had to be deleted by hand withxcrun simctl delete <udid>.
The limit is a constant, so no setting makes these copies succeed.
Cause, at d30c24d8 (the same lines are in v0.7.0):
src/drivers/ios/index.ts:108:const COMMAND_TIMEOUT_MS = 30_000;is the limit of everysimctlcall, including the three that copy or create a whole simulator: the clone inprovision(index.ts:933-938), the clone insaveSource(index.ts:851-854) and thecreatein#makeSeed(index.ts:1036-1045).ios.full.bootTimeoutMsandios.slim.bootTimeoutMscover the boot wait only.#invokeCommand(index.ts:2060-2095) sendsSIGTERMtoxcrun simctlat the limit. The copy itself is done by CoreSimulator's service, which carries on, so the simulator still appears, after the driver has thrown with no UDID in hand.- In
provisionthe mark is written only onceclonehas answered (index.ts:940-947), and the delete-on-failure there (index.ts:949-953) needs that UDID. Underdefault,listManagedreports only simulators whose durable mark names this instance (index.ts:1539-1553), so the late simulator is never listed, never an orphan and never deleted. It is the end statesrc/drivers/ios/AGENTS.mdlists as a known gap for a restart betweensimctl cloneand the mark (iOS simulators can live in Xcode's device set (drivers.ios.deviceSet) #968), reached here with no restart.
Under deviceSet: "simlock", and for a seed or a baseline (both live in the sources set), the same timeout leaves a simulator in a Simlock-owned set, which doctor --purge-orphans can still reach. The creation still fails.
What you expected
- A setting for how long a
simctl cloneorsimctl createmay take, asios.full.bootTimeoutMsis for a boot, with today's 30 s as its default. - A creation that fails or runs out of time never leaves a simulator that Simlock cannot find and delete, under
defaultas well.
A possible fix (I am preparing it on a fork and will link a draft pull request here; close it if that is not welcome):
- A driver key, for example
ios.simulator.createTimeoutMs(positive number, default30000), read by the three calls in point 1. Every othersimctlcall keeps 30 s. - At that limit the driver stops waiting but does not kill
simctl clone/simctl create. When the command later prints its UDID, the driver deletes that simulator. The UDID comes from the driver's own call, so ownership is proven the same way as in the existing delete after a failed mark write, with no reliance on thesimlock-name (safety rule 8). The late copy keeps the seed's turn until it ends, so the seed is not deleted under it. A command still silent after a second, fixed limit is killed and logged with the name it was asked to create.
How to reproduce
- On a Mac, set
drivers.ios.deviceSetto"default"andios.defaultModeto"slim"inconfig.json, and start the daemon. - Put the Mac under heavy CPU and disk load (here: other builds and simulator test runs on the same Mac; load average 300 to 900 on 16 cores).
simlock lease --platform ios, or let the warm pool create a device, a few times.- Requests fail with
simctl clone … timed out after 30000ms. xcrun simctl list devices | grep simlock-then shows simulators thatsimlock statusdoes not list, andsimlock doctor --purge-orphansandsimlock nuke --delete-devices --yesleave in place.
Here it happened on most creations while the load lasted (4 of 4 warm-pool creations, 4 of 5 baseline saves). On an idle Mac the same clone takes a few seconds and nothing fails.
Environment
- Simlock 0.7.0 (npm), worker mode
- iOS simulators, iOS 27.0 runtime, slim mode
- macOS 27.2.1, Xcode 27.2 (27B52), Apple silicon, 16 cores, 48 GB
drivers.ios.deviceSet: "default"
Logs and evidence
From daemon.log, with folders shortened and names replaced by placeholders:
warn daemon.warm-pool "warm pool creation of a device failed" model="iPhone 18 Pro Max" step="provision"
error="DriverCrashError: simctl clone <seed udid> simlock-<id> ~/Library/Developer/CoreSimulator/Devices timed out after 30000ms"
info daemon.server.dispatch operation="baseline.save" durationMs=34150 code="BASELINE_SAVE_FAILED"
message="baseline <name> was not saved: simctl clone <device udid> simlock-baseline-<id> <simlock home>/devices/ios-sources timed out after 30000ms"
No existing issue covers this: #1248 / #1315 made the boot wait configurable and left the 30 s simctl limit out of scope, and #968's known gap is the restart case.
Activity
dpearson2699 commentedon Nov 13, 2026
Draft fix from a fork: #1547 (
ios.simulator.createTimeoutMs, and a create or clone that answers after it is deleted instead of left behind).Written by an agent.
fix(ios): simctl boot, shutdown and delete wait the same limit, now i…
fix(ios): simctl boot, shutdown and delete wait the same limit, now i…
chore(release): 0.7.0-bug1546.2
dpearson2699 commentedon Nov 13, 2026
One more measurement from the same Mac, with #1547's first commit (the limit raised for
createandcloneonly) and a load average near 1000: abaseline savewhose clone took 53 s now succeeded, but the next lease failed after 35 s withBootTimeoutError, and the destroy that followed failed withsimctl shutdown <udid> timed out after 30000ms. Sosimctl bootandsimctl shutdownpass the same fixed 30 s there (src/drivers/ios/index.ts:1253,:1263and:1994atd30c24d8). #1547 now givescreate,clone,boot,shutdownanddeleteone key,ios.simulator.lifecycleTimeoutMs, instead of theios.simulator.createTimeoutMsnamed above.Written by an agent.
chore(release): 0.7.0-bug1546.3
V3RON commentedon Nov 15, 2026
Reproduction
Branch
bug/1546-repro,src/drivers/ios/index.test.ts. The first test is a proposal: its key name is Simplest fix's.Root cause
A gap with a defect inside it. Gap:
src/drivers/ios/index.ts:108(COMMAND_TIMEOUT_MS) is the only limit on the clone inprovision(:936), the clone insaveSource(:853) and thecreatein#makeSeed(:1043), and no key changes it. Defect: at the limit#invokeCommand(:2066-2073) killssimctl, but the copy still finishes. The delete inprovision(:949-953) needs a UDID that the killed command never printed. Underdefault,listManaged(:1539) lists only marked simulators, so nothing can reach the copy. This breaks architecture rule 11: a caller that times out must leave the far side no worse off. The issue's points 1 to 3 hold.Simplest fix
Gap, proposed shape:
ios.simulator.createTimeoutMs(positive number, default30000) indefinition.ts, read by the three calls. Defect: at that limit the call rejects but does not kill. The command keeps the seed's turn. When it answers late with a UDID, that simulator is deleted in the set it landed in. A second fixed limit kills it and logs.Alternatives rejected
simlock-<id>name: breaks safety rule 8.ios.simulator.lifecycleTimeoutMsfor create, clone, boot, shutdown and delete (fix(ios): the simctl commands of a simulator's lifecycle wait ios.simulator.lifecycleTimeoutMs, and a create or clone that answers late is deleted (#1546) #1547): it spreads the key past this bug, and boot already has a deadline (iOS: simctl boot is cut off at a fixed 30 s outside ios.*.bootTimeoutMs, and the boot deadline starts only after it #1560).Risk
removeComponent) waits behind a late clone, up to the second limit.defaultacts on an unmarked UDID. It is proven only by the driver's own call, as in the failed-mark delete (safety rules 1 and 8).Fast track
Side findings
Written by an agent.
V3RON commentedon Nov 15, 2026
Decision
The maintainer chose the narrow key:
drivers.ios.simulator.createTimeoutMs(positive number, default30000), read only by the three calls that copy or create a whole simulator: the clone inprovision, the clone insaveSourceand thecreatein#makeSeed. Every othersimctlcall (boot, shutdown, delete and the rest) keeps the fixed 30 s;simctl bootis #1560, not this fix. The lifecycle-wide key of #1547 is not taken.Tests: the triage's
$call waits ios.simulator.createTimeoutMstable (provision clone, seed create, baseline clone stay pending at 119 999 ms of a 120 000 ms limit), andunder deviceSet default a provision whose clone answers after its limit deletes the simulator the clone names, onbug/1546-repro(d1eb61ef).Written by an agent.
test(daemon): the discovered ios.simulator section carries the create…
12 remaining items
fix(ios): the runtime's deletion budget starts after its seeds are de…
test(ios): the deletion budget test expects the removal's size (#1546)
refactor(ios): the driver's constructor hands its after-boot and sour…
V3RON commentedon Nov 15, 2026
Handoff
Done
#1563 (ready, head
a5af2d14) passed review: round 1, round 2 and three fix-checks, the last two approved by the maintainer past the cap. R1, R2, R5 and R6 are fixed, R7 is rejected as nonblocking, and the review ledger is posted. The Fallow constructor complexity failure is fixed by extraction, which the review coordinator verified.Not done
Not merged. The gate's second run refused:
not merged: CI not green on PR #1563: fail Quality;fail Unit tests;.Findings
src/source-hygiene.test.ts"fails a listed file that grew past its listed length" (CI run 43721811488, classifiedreach). The extraction ina5af2d14added 5 net lines tosrc/drivers/ios/index.ts, which was at 2696 against its listed 2700.Blocked on
Red CI a second time at the gate parks the PR. The maintainer decides: one fix run that brings
index.tsback under 2700 (for example by movingsourcesSetForout), then a coordinator check and the gate; or a fix by hand.Written by an agent.
V3RON commentedon Nov 15, 2026
Delivery run
Merged: none
Parked: #1546 — gate refused twice:
src/drivers/ios/index.tsover its listed 2700 lines after the Fallow fix (#1563)Decided: #1546 — three untested late-copy behaviours → kept as built and pinned by tests
Written by an agent.
refactor(ios): sourcesSetFor moves to source-data.ts so index.ts stay…
V3RON commentedon Nov 15, 2026
Delivery run
Merged: #1563 (#1546)
Decided: #1546 — three untested late-copy behaviours → kept as built and pinned by tests
Written by an agent.
fix(ios): a simulator's clone or create waits ios.simulator.createTim…