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: main-update.test.ts version check test times out at 20 s on the Windows unit job #1913
bug:blockedAgent stopped on a blocker in its handoff. Maintainer re-adds the label it came from.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/daemon/main-update.test.ts, "startDaemon version check > a daemon runs the version check at start without delaying ready, then after 24 h, and reports a newer latest in status.get and the daemon.update query; npm failing or answering junk keeps the last value; a stopped daemon never schedules the next check", timed out on the Windows unit job on two branches that do not touch the daemon:
Error: Test timed out in 20000ms.
❯ src/daemon/main-update.test.ts:291:3
Both runs are from 2026-11-25, before #1886 changed the version check and this file. It is not among the Windows-only failures since; triage may find it fixed.
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).
Not fixed by #1886/#1887: on main (7efa617) the test still takes 11 s of 20 s. Every daemon this file starts runs a real powershell.exe to read the data directory's ACL; the test starts five.
src/daemon/test-daemons-host-load.test.ts on bug/1913-repro, "daemons started by tests under src/ > pass a directoryAccess reader, so none starts PowerShell on Windows to read its data directory's ACL". It reuses the hostLoadProbe guard's scanner, with the option name as a parameter.
$ pnpm exec vitest run --project unit src/daemon/test-daemons-host-load.test.ts
× pass a directoryAccess reader, so none starts PowerShell on Windows to read its data directory's ACL
AssertionError: expected [ …(67) ] to deeply equal []
+ "src/daemon/main-update.test.ts:53", (startChecked: all five starts in the flaky test)
+ "src/daemon/main-update.test.ts:100", … 67 starts in 24 files
Test duration, Windows CI:
2026-11-25 run 45570704146 20170 ms (timed out)
2026-11-25 run 45621989246 22666 ms (timed out; the file's first test, 4 failed starts: 18451 ms)
2026-11-27 run 46061249516 11054 ms (main, passed)
Root cause
A defect in the test rig. src/daemon/main.ts:233-234 falls back to new PowerShellDirectoryAccessReader(...) when no directoryAccess is passed. On win32, prepareDataDirectory (src/daemon/connection-host.ts:70) then spawns PowerShell on every start. startChecked (main-update.test.ts:53) passes no reader. start in test-main.ts:49 passes a fake because of this exact cost, but 67 other starts do not. At 1–4.6 s per spawn on a loaded runner, five plus the polls pass 20 s. Inferred from CI durations (the same file runs in under 1 s on macOS); the Windows machine was unreachable to time PowerShell directly.
Simplest fix
Pass directoryAccess: new FakeDirectoryAccessReader({ entries: [], user: "S-1-5-21-1-2-3-1001" }) next to hostLoadProbe in the 67 starts. Tried mechanically (25 files, +111/−12):
vitest run --project unit src/daemon/test-daemons-host-load.test.ts → 2 passed
vitest run --project unit <the 20 changed test files> → 179 passed
vitest run --project unit <helper users: main-worker-lock, main-start-daemon, agent-device> → 402 passed
tsc --noEmit (src, packages/e2e) → clean
Done: PR #1934 adds a fake directoryAccess reader to every test daemon start, so no test starts PowerShell on Windows. A guard test in test-daemons-host-load.test.ts fails on any start without one. Audit clean. Review round 1: 0 blocking findings, one note (the guard's file scan now runs twice). The PR is ready.
Not done: merge.
Findings: none blocking. #1914 and a main-stop.test.ts flake probably share this cause, per the triage report.
Blocked on: fast-track: #1913 held: PR #1934 changes 302 lines, over 250; PR #1934 changes 25 files, over 8. The maintainer merges the PR, or removes fast-track.
Merged: none
Parked: #1913 — PR #1934 held by the fast track (302 lines, 25 files); ready for the maintainer to merge
Waiting: none
Decided: none
Asleep: 133 min
Fixed by #1935, merged as 9457a80: no daemon a test starts runs PowerShell on Windows, the five in main-update.test.ts included. The duplicate fix #1934 is closed.
bug:blockedAgent stopped on a blocker in its handoff. Maintainer re-adds the label it came from.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
Not fixed by #1886/#1887: on main (7efa617) the test still takes 11 s of 20 s. Every daemon this file starts runs a real
powershell.exeto read the data directory's ACL; the test starts five.src/daemon/test-daemons-host-load.test.tsonbug/1913-repro, "daemons started by tests under src/ > pass a directoryAccess reader, so none starts PowerShell on Windows to read its data directory's ACL". It reuses the hostLoadProbe guard's scanner, with the option name as a parameter.Test duration, Windows CI:
Root cause
A defect in the test rig.
src/daemon/main.ts:233-234falls back tonew PowerShellDirectoryAccessReader(...)when nodirectoryAccessis passed. On win32,prepareDataDirectory(src/daemon/connection-host.ts:70) then spawns PowerShell on every start.startChecked(main-update.test.ts:53) passes no reader.startintest-main.ts:49passes a fake because of this exact cost, but 67 other starts do not. At 1–4.6 s per spawn on a loaded runner, five plus the polls pass 20 s. Inferred from CI durations (the same file runs in under 1 s on macOS); the Windows machine was unreachable to time PowerShell directly.Simplest fix
Pass
directoryAccess: new FakeDirectoryAccessReader({ entries: [], user: "S-1-5-21-1-2-3-1001" })next tohostLoadProbein the 67 starts. Tried mechanically (25 files, +111/−12):Alternatives rejected
main-update.test.ts: 62 starts keep the cost.main.ts's default: production must read the ACL.Risk
Fast track
Written by an agent.
V3RON commentedon Nov 28, 2026
Handoff
Done: PR #1934 adds a fake
directoryAccessreader to every test daemon start, so no test starts PowerShell on Windows. A guard test intest-daemons-host-load.test.tsfails on any start without one. Audit clean. Review round 1: 0 blocking findings, one note (the guard's file scan now runs twice). The PR is ready.Not done: merge.
Findings: none blocking. #1914 and a
main-stop.test.tsflake probably share this cause, per the triage report.Blocked on: fast-track: #1913 held: PR #1934 changes 302 lines, over 250; PR #1934 changes 25 files, over 8. The maintainer merges the PR, or removes
fast-track.Written by an agent.
V3RON commentedon Nov 28, 2026
Delivery run
Merged: none
Parked: #1913 — PR #1934 held by the fast track (302 lines, 25 files); ready for the maintainer to merge
Waiting: none
Decided: none
Asleep: 133 min
Written by an agent.
V3RON commentedon Nov 30, 2026
Fixed by #1935, merged as 9457a80: no daemon a test starts runs PowerShell on Windows, the five in
main-update.test.tsincluded. The duplicate fix #1934 is closed.Written by an agent.