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
flaky: LocalTaskProvider readiness-reap test times out on CI #486
area:serverTouches the server areabugSomething isn't workingflakyA test that fails without a code cause; check these before treating a red check as yoursready-for-agentFully specified, ready for an AFK agent
packages/execution/src/LocalTaskProvider.test.ts › "reaps a task that misses readiness instead of retaining a running fleet slot" timed out at 10.9s against its 10s budget on the test (24) job, with no code cause. The PR only touched runtime-package tests; the other 1606 tests passed, and test (22) passed on the same commit.
The test spawns a real local task with execution.pool.wait at 1, waits for start to fail, then reaps it. Process spawn plus reap on a busy runner can exceed the fixed 10s timeout. The same family of slow execution tests also timed out locally under parallel pnpm verify load (Fleet.test.ts, Inspection.test.ts).
Category: bug Summary: The local task owner treats a process disappearing mid-/proc-read as a failure, so a task that misses readiness can hang start until its ~10s deadline.
Current behavior:
When a local task misses readiness, its detached owner SIGKILLs the task's process group, then scans /proc (groupMembers) to certify no descendants remain before writing the stopped record. The local task store's process readers (processIdentity, groupMembers) treat only ENOENT as "process gone". If any process on the machine is reaped between open and read of its /proc/<pid>/stat, the read fails with ESRCH. That error escapes, so the owner exits without writing stopped. LocalTaskProvider.start then polls the stale running record until its own deadline (readiness wait + cleanup + kill grace, about 10s) and fails with transport.
Only the killed-before-readiness path scans /proc, because normal stops carry final stats and skip it. That is why "reaps a task that misses readiness…" is the only test in its file that flakes. Busy runners make the race likelier.
The same class exists at the owner's two "check alive, then SIGKILL" sites: recovering a previous owner's child group, and reaping leftover descendants. A process exiting between the check and the kill throws ESRCH. The readiness-miss kill already tolerates it.
Desired behavior:
A process disappearing during any /proc read or kill in the local task owner or store means "already gone", never a failure. ENOENT and ESRCH both mean gone, matching the execution process launcher's /proc reader and the CLI dev state's missingProcess.
Key interfaces:
Local task store: processIdentity() returns null, and groupMembers() skips the entry, when a /proc read fails with ENOENT or ESRCH.
Local task owner: every process.kill on a pid previously seen alive tolerates ESRCH.
Reproduction (verified):
Reading a reaped process's stat through an already-open handle fails with ESRCH. Opening it after the reap fails with ENOENT.
With ~400 sleep 0.1–0.5 processes churning, groupMembers threw ESRCH in 10 of 249 scans.
Under the same churn the test timed out 4 times in 40 runs, at 10.5–11.3s (CI saw 10.9s; the passing rerun took 856ms, and its three siblings ran at normal speed in the failing run). With ESRCH treated as gone it passed 40/40.
Raising the test budget to 30s does not help: with an injected ESRCH the test still fails at about 10.4s, with transport instead of provider.
Acceptance criteria:
A focused test shows a process reaped between open and read reads as gone, not as an error.
The readiness-reap test passes repeatedly under heavy process churn, with its 10s budget unchanged.
pnpm verify passes.
Out of scope:
Raising the test timeout. The healthy path takes under 1s.
Making start notice a dead owner and relaunch it, or having the owner certify stopped on an unknown failure. It deliberately never certifies an exit it did not observe.
The Fleet.test.ts and Inspection.test.ts timeouts under local load. Inspection doesn't use the detached owner; file them separately if they recur.
area:serverTouches the server areabugSomething isn't workingflakyA test that fails without a code cause; check these before treating a red check as yoursready-for-agentFully specified, ready for an AFK agent
Activity
allisonmahmood commentedon Oct 2, 2026
Agent Brief
Category: bug
Summary: The local task owner treats a process disappearing mid-
/proc-read as a failure, so a task that misses readiness can hangstartuntil its ~10s deadline.Current behavior:
When a local task misses readiness, its detached owner SIGKILLs the task's process group, then scans
/proc(groupMembers) to certify no descendants remain before writing thestoppedrecord. The local task store's process readers (processIdentity,groupMembers) treat onlyENOENTas "process gone". If any process on the machine is reaped betweenopenandreadof its/proc/<pid>/stat, the read fails withESRCH. That error escapes, so the owner exits without writingstopped.LocalTaskProvider.startthen polls the stale running record until its own deadline (readiness wait + cleanup + kill grace, about 10s) and fails withtransport.Only the killed-before-readiness path scans
/proc, because normal stops carry final stats and skip it. That is why "reaps a task that misses readiness…" is the only test in its file that flakes. Busy runners make the race likelier.The same class exists at the owner's two "check alive, then SIGKILL" sites: recovering a previous owner's child group, and reaping leftover descendants. A process exiting between the check and the kill throws
ESRCH. The readiness-miss kill already tolerates it.Desired behavior:
A process disappearing during any
/procread or kill in the local task owner or store means "already gone", never a failure.ENOENTandESRCHboth mean gone, matching the execution process launcher's/procreader and the CLI dev state'smissingProcess.Key interfaces:
processIdentity()returnsnull, andgroupMembers()skips the entry, when a/procread fails withENOENTorESRCH.process.killon a pid previously seen alive toleratesESRCH.Reproduction (verified):
ESRCH. Opening it after the reap fails withENOENT.sleep 0.1–0.5processes churning,groupMembersthrewESRCHin 10 of 249 scans.ESRCHtreated as gone it passed 40/40.ESRCHthe test still fails at about 10.4s, withtransportinstead ofprovider.Acceptance criteria:
openandreadreads as gone, not as an error.pnpm verifypasses.Out of scope:
startnotice a dead owner and relaunch it, or having the owner certifystoppedon an unknown failure. It deliberately never certifies an exit it did not observe.Fleet.test.tsandInspection.test.tstimeouts under local load. Inspection doesn't use the detached owner; file them separately if they recur.fix(execution): a process exiting mid-/proc read no longer hangs loca…