fix(ios): bound lifecycle rpcs and claim the target device

a launch the simulator rejects sent the xctest session into a recovery
chain that answered minutes late or never, and the rpc had no deadline,
so the run hung with no trace and no error. also take a per-udid flock:
a second run's reinstall lands under the first's live automation session
and wedges it.
This commit is contained in:
pj committed 2026-08-13 21:05:16 +05:30
1 parent 0a8b441d35
commit 0c249ec261
3 files changed
+250 -4

No files matched your search

+7
View File
@@ -109,6 +109,13 @@ func NewDevice(ctx context.Context, options DeviceOptions) (*Driver, error) {
d.restart = d.respawnDevice
d.processContext, d.processCancel = context.WithCancel(ctx)
lock, err := acquireDeviceLock(d.udid)
if err != nil {
d.processCancel()
return nil, err
}
d.deviceLock = lock
if err := d.bringUpDevice(ctx); err != nil {
d.Close()
return nil, err