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: edge-request-rules-devices.test.ts boot test times out at 20 s on the Windows unit job #1912
bug:readyAn agent may fix it.fast-trackBug set ready by the fast-track check, not the maintainer (rule 17).flaky-testNames a test that fails without a code change. Delivery skips its base-commit check.
src/agent-device/edge-request-rules-devices.test.ts, "the agent-device front's request rules > A runner sends boot on its lease and simlock answers it; agent-device gets no boot", timed out on the Windows unit job of PR #1903 at 94ed2a3 (CI run 45971550656). The PR changes two files under docs/internal/adr/. Its next push (f7f3882, also ADR only) passed.
Error: Test timed out in 20000ms.
❯ src/agent-device/edge-request-rules-devices.test.ts:403:3
Error: Hook timed out in 20000ms.
❯ src/agent-device/test-support.ts:18:1
The run includes #1868 and #1887 (test daemons start without the host's real load probe).
What you expected
The test passes on every run.
How to reproduce
Not reproduced locally. No failed run was re-run in place; the commits above change no code the test reads, and the test passes on the runs around them.
Environment
CI: windows-2025, job Unit tests (Windows), pnpm run test:unit (all unit files in one run, 20 s test and hook timeout).
Confirmed from the CI logs. The new test pins the cause the rig controls: src/agent-device/worker-rig-directory-access.test.ts, "the agent-device worker test rig > starts its daemon, the phone rig's daemon and a restarted daemon without building the host's real directory-access reader", on bug/1912-repro.
pnpm exec vitest run --project unit src/agent-device/worker-rig-directory-access.test.ts
AssertionError: after setUp: expected 1 to be +0
❯ src/agent-device/worker-rig-directory-access.test.ts:25:40
The boot test starts nine rig daemons in one 20 s test. Windows unit job timings, from the job logs:
boot test, passing shards (4 runs): 6404 / 8218 / 8539 / 8783 ms
run 45971550656: the file's other tests 1.0-1.4 s each (normal); boot test 42067 ms (20 s test + 20 s hook)
macOS, same file, discarded probe: setUp 17-28 ms, stop 2-13 ms, rm <= 1 ms
Root cause
Defect in the test rig. src/agent-device/test-support.ts:170 calls startDaemon without directoryAccess. So src/daemon/main.ts:234 builds PowerShellDirectoryAccessReader, and on win32 prepareDataDirectory (src/daemon/connection-host.ts:70) waits for a real powershell.exe run (10 s limit) before each rig daemon serves. The boot test pays that nine times in a row. On a loaded runner where PowerShell takes more than about 2 s, the test passes 20 s. After the timeout the test keeps starting daemons, which loads the runner further while the afterEach stops and removals run, and that hook timed out too. src/daemon/test-main.ts:48-49 already fakes the reader for this reason.
Simplest fix
In src/agent-device/test-support.ts, pass directoryAccess: new FakeDirectoryAccessReader({ user: "S-1-5-21-1-2-3-1001", entries: [] }) with test-main.ts's why: line.
Split the boot scenarios into it.each: gives each scenario its own budget, but every rig start still waits on PowerShell.
Raise the test's timeout: hides the wait, and the next test with many rigs hits it.
Skip the reader in startDaemon under tests: production code would then know about tests.
Risk
No Windows run was made. The claim that PowerShell is where the time goes rests on the CI timings and test-main.ts's own note. The next Windows unit runs after the fix will show it.
bug:readyAn agent may fix it.fast-trackBug set ready by the fast-track check, not the maintainer (rule 17).flaky-testNames a test that fails without a code change. Delivery skips its base-commit check.
Activity
V3RON commentedon Nov 28, 2026
Reproduction
Confirmed from the CI logs. The new test pins the cause the rig controls:
src/agent-device/worker-rig-directory-access.test.ts, "the agent-device worker test rig > starts its daemon, the phone rig's daemon and a restarted daemon without building the host's real directory-access reader", onbug/1912-repro.The boot test starts nine rig daemons in one 20 s test. Windows unit job timings, from the job logs:
Root cause
Defect in the test rig.
src/agent-device/test-support.ts:170callsstartDaemonwithoutdirectoryAccess. Sosrc/daemon/main.ts:234buildsPowerShellDirectoryAccessReader, and on win32prepareDataDirectory(src/daemon/connection-host.ts:70) waits for a realpowershell.exerun (10 s limit) before each rig daemon serves. The boot test pays that nine times in a row. On a loaded runner where PowerShell takes more than about 2 s, the test passes 20 s. After the timeout the test keeps starting daemons, which loads the runner further while theafterEachstops and removals run, and that hook timed out too.src/daemon/test-main.ts:48-49already fakes the reader for this reason.Simplest fix
In
src/agent-device/test-support.ts, passdirectoryAccess: new FakeDirectoryAccessReader({ user: "S-1-5-21-1-2-3-1001", entries: [] })with test-main.ts'swhy:line.Alternatives rejected
it.each: gives each scenario its own budget, but every rig start still waits on PowerShell.startDaemonunder tests: production code would then know about tests.Risk
npm view(Daemon tests that start a daemon without an npm fake ask the real npm registry for simlock@latest #1885). This fix leaves that in place.Fast track
Side findings
Written by an agent.
V3RON commentedon Nov 28, 2026
Delivery run
Merged: #1933 (#1912)
Parked: none
Waiting: none
Decided: none
Asleep: 165 min
Written by an agent.
chore(agents): an outsider's bug never merges alone, one switch pause…
fix(test): every daemon a test starts passes a fake directory-access …