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
slow lane: gateway Android suite times out booting under load and leaves orphaned emulators #1102
The slow lane's gateway Android suite (e2e/slow-agent-device-gateway.test.ts, "with the device limit raised to 2") fails in setup under heavy host load, and the lane leaves orphaned simlock emulators behind.
1. Boot timeout under load.warmUp (e2e/helpers/agent-device-targets.ts:154) gets lease code 1, INTERNAL: Timed out waiting for device to boot (etaMs 70000), then the 330 s warm-up times out. One earlier run instead timed out in setLimits (agent-device-targets.ts:144, "previous daemon process exited", 30 s). It fails the same way on main 795733b with agent-device 0.21.32 and on #1094 with 0.21.35, so the agent-device version is not the cause. The 15-min load was 120-274 during the runs (Spotlight and mediaanalysisd ~250% CPU).
2. Orphaned emulators. After the gateway Android suite, qemu-system-aarch64 -avd simlock_<id>, netsimd and crashpad_handler keep running with ppid 1. Seen after 3 runs (for example pid 19449, avd simlock_8dcea1d6, port 5586 on main). The next lane's start-of-run cleanup stops them, but they add to the load in the meantime.
#1077 (merged today) changed the daemon stop and teardown order; it may be related to (2) and the restart wait.
Defect in the e2e harness. Part 1 is the host: Android boot has a fixed 180 s limit (src/drivers/android/index.ts:87) and the load was 120-274. Part 2: #1150 now shuts down ready devices at daemon stop, which covers passing runs, but not a leased device. warmUp leaves its warm-up leases held when a later one fails, which is the main run's path (warmup-2 timed out, warmup-1 stayed leased).
e2e/helpers/agent-device-targets.test.ts, "when a later warm-up lease fails, rejects and leaves none of the warm-up leases it took held" (fake driver, branch bug/1102-repro):
e2e/helpers/agent-device-targets.ts:154: the failing expect throws out of the lease loop, so the release loop at :157 never runs. Teardown (e2e/helpers/env.ts:479) runs daemon stop, which keeps leased devices running (ADR 0004 §3, kept by #1150), then deletes the home. It empties only the iOS device set (env.ts:501), so the held emulator runs on with ppid 1.
Simplest fix
Wrap the lease loop in try/finally and release the ids taken so far in the finally. The test passes with it locally.
Alternatives rejected
Teardown runs release --all --yes before daemon stop: every teardown would also wait for reclaims, under the stop waits that already time out.
An Android twin of emptyDeviceSet in teardown: duplicates scripts/slow-e2e.sh clean.
A longer Android boot limit for part 1: hides an overloaded host.
Risk
Proven with the fake driver only; no slow-lane run.
Activity
chore(deps): bump @agent-device/proxy to 0.21.35 (#1094)
test: reproduce #1102 — warmUp leaves its warm-up leases held when a …
V3RON commentedon Oct 31, 2026
Reproduction
Defect in the e2e harness. Part 1 is the host: Android boot has a fixed 180 s limit (
src/drivers/android/index.ts:87) and the load was 120-274. Part 2: #1150 now shuts downreadydevices atdaemon stop, which covers passing runs, but not a leased device.warmUpleaves its warm-up leases held when a later one fails, which is the main run's path (warmup-2 timed out, warmup-1 stayed leased).e2e/helpers/agent-device-targets.test.ts, "when a later warm-up lease fails, rejects and leaves none of the warm-up leases it took held" (fake driver, branchbug/1102-repro):Root cause
e2e/helpers/agent-device-targets.ts:154: the failingexpectthrows out of the lease loop, so the release loop at :157 never runs. Teardown (e2e/helpers/env.ts:479) runsdaemon stop, which keeps leased devices running (ADR 0004 §3, kept by #1150), then deletes the home. It empties only the iOS device set (env.ts:501), so the held emulator runs on with ppid 1.Simplest fix
Wrap the lease loop in
try/finallyand release the ids taken so far in thefinally. The test passes with it locally.Alternatives rejected
release --all --yesbeforedaemon stop: every teardown would also wait for reclaims, under the stop waits that already time out.emptyDeviceSetin teardown: duplicatesscripts/slow-e2e.sh clean.Risk
env.ts:401, timed out in 2 of 4 runs). fix(daemon): daemon stop shuts down idle devices (#1056) #1150 makes stop slower.Side findings
Written by an agent.
V3RON commentedon Oct 31, 2026
Delivery run
Merged: #1160 (#1102)
Parked: none
Waiting: none
Written by an agent.
fix(e2e): warmUp releases its warm-up leases when a later one fails (c…