You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
iOS runCommand passes timeoutMs to spawn, which ignores it, and its comment relies on that backstop #1980
src/drivers/ios/command-run.ts:24-26 computes runnerTimeoutMs and passes it to processRunner.spawn, with the comment "the runner's own timeout is a backstop past the late kill". NodeProcessRunner.spawn reads no timeoutMs, so there is no backstop. runCommand itself still answers at its own clock timer, but a command that ignores the one SIGTERM it sends is never escalated to SIGKILL.
ProcessRunOptions (src/ports/process-runner-types.ts:2) accepts timeoutMs for spawn although the ports manual says spawn takes none, so the compiler flags neither this call nor the one in #1979.
Read in the code on origin/main at dead1fb, not run. Found while triaging #1979.
Seen on: fakes (scripted runner, fake clock). A scratch run with the real NodeProcessRunner and a Node child ignoring SIGTERM agreed. Not seen from a real simctl.
src/drivers/ios/index-seed-sources.test.ts on bug/1980-repro: "a simctl command that ignores the SIGTERM sent when its time is up is sent SIGKILL 10 s later, and one that ends at the SIGTERM is not".
Defect, as filed, and worse than filed for a clone. src/drivers/ios/command-run.ts:38 sends one SIGTERM; the backstop named at line 24 does not exist, because spawn arms no timer (src/ports/node-process-runner.ts:106). A late clone that ignores SIGTERM never settles waited, so onSettled never runs (line 52) and SeedTurns.hold (src/drivers/ios/simctl.ts:112) never lifts: deleting that seed waits forever and nothing is logged. The iOS manual promises "5 silent minutes more kills and logs it". Scratch measurements:
real child, 13 s after its limit: today alive fixed gone
seed deletion, 24 h after a clone: today pending fixed done at 340 s, 1 warning
Simplest fix
In runCommand, after the SIGTERM set a 10 s clock timer that sends SIGKILL, cancelled when waited settles. Correct the comment. Keep the argument for now (side finding).
fix tried, then restored
vitest unit, src/drivers/ios + driver-contract + src/ports: 1222 passed | 58 skipped
pnpm test:changed: 1808 passed | 47 skipped; pnpm typecheck: clean
timer not cancelled: the reproduction fails
Alternatives rejected
NodeProcessRunner.spawn honours timeoutMs: contradicts the ports manual.
Only drop the argument and comment: the hang stays, and 41 tests fail.
Switch to run: its timer bypasses the injected clock, and late needs the handle.
Risk
Today a clone that ignores SIGTERM and answers after 340 s has its copy deleted; killed, it leaves the copy, with a warning. simctl imports signal handlers (nm -u); which signals is unmeasured.
The grace applies to every runCommand caller: simctl, devicectl, open, defaults, pgrep.
10 s copies installer-process.ts and NodeProcessRunner; the test pins it.
Fast track
Defect: yes
Fix tried: yes
Nothing public added or broken: no — a clone answering after 340 s despite SIGTERM is cleaned up today and would not be
No ADR or rule changed: yes
One fix: no — sparing the late clone from SIGKILL would change what is left on disk
Activity
V3RON commentedon Nov 30, 2026
Reproduction
Seen on: fakes (scripted runner, fake clock). A scratch run with the real
NodeProcessRunnerand a Node child ignoring SIGTERM agreed. Not seen from a realsimctl.src/drivers/ios/index-seed-sources.test.tsonbug/1980-repro: "a simctl command that ignores the SIGTERM sent when its time is up is sent SIGKILL 10 s later, and one that ends at the SIGTERM is not".Root cause
Defect, as filed, and worse than filed for a clone.
src/drivers/ios/command-run.ts:38sends one SIGTERM; the backstop named at line 24 does not exist, becausespawnarms no timer (src/ports/node-process-runner.ts:106). A late clone that ignores SIGTERM never settleswaited, soonSettlednever runs (line 52) andSeedTurns.hold(src/drivers/ios/simctl.ts:112) never lifts: deleting that seed waits forever and nothing is logged. The iOS manual promises "5 silent minutes more kills and logs it". Scratch measurements:Simplest fix
In
runCommand, after the SIGTERM set a 10 s clock timer that sends SIGKILL, cancelled whenwaitedsettles. Correct the comment. Keep the argument for now (side finding).Alternatives rejected
NodeProcessRunner.spawnhonourstimeoutMs: contradicts the ports manual.run: its timer bypasses the injected clock, andlateneeds the handle.Risk
simctlimports signal handlers (nm -u); which signals is unmeasured.runCommandcaller:simctl,devicectl,open,defaults,pgrep.installer-process.tsandNodeProcessRunner; the test pins it.Fast track
Side findings
Written by an agent.
fix(ios): the command-run comment no longer calls the runner's timeou…