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
tests: load-dependent failures in the packages/codev suite on a native Windows dev machine (agy-auth-cache EPERM, metrics-model-id barrier, windows-job census, worker exit) #1923
After #1922's fixes, three full runs of packages/codev on a native Windows developer machine (Windows 11, live Tower on 4100, run from inside a builder session) each failed a different small set of tests. Every one passes when its file runs alone (2-3 targeted runs each). They are load-dependent and Windows-host specific; the GitHub Windows workflow does not show them.
Run
Failures
1
agy-auth-cache "lets a late OAuth banner overwrite the speculative auth verdict" (EPERM), plus Worker exited unexpectedly
2
metrics-model-id "survives concurrent first-open by several processes" (children did not reach the barrier within 20s), plus Worker exited unexpectedly
3
windows-job.windows "terminating the job ends a cmd start /b orphan…" (line 198), agy-auth-cache "keeps spawning per call when the cache is disabled" (EPERM)
1. agy-auth-cache: EPERM removing the temp dir
removeFakeCliTempDir (src/commands/consult/__tests__/fake-cli-temp-dir.ts) retries 20× and tolerates a lingering EBUSY on Windows, but these runs hit EPERM:
Error: EPERM, Permission denied: \?\C:\Users\…\Temp\agy-auth-cache-test-ww7UIm
at removeFakeCliTempDir (fake-cli-temp-dir.ts:15:8)
at agy-auth-cache.test.ts:158:3
The survivor check in the same afterEach runs first and found no live fake agy. The holder is unidentified (AV/indexer scanning the freshly written agy.cjs/agy.cmd is a candidate). Not the same as #1435/#1460/#1596 (TTL race).
children did not reach the barrier within 20s (metrics-model-id.test.ts:269): child processes start too slowly under full-suite load.
3. windows-job.windows: census race
windows-job.windows.test.ts:198, expect(census.some((entry) => entry.pid === leaf!.ppid)).toBe(false): the orphan leaf's cmd parent was still in the census (it had not yet exited, or its PID was reused).
4. Worker exited unexpectedly (2 of 3 runs)
[vitest-pool]: Worker forks emitted error … Caused by: Error: Worker exited unexpectedly. Run 2 counted ~87 fewer tests than run 3, so a file's tests were lost. The default reporter does not name the file; run 3 (JSON reporter) did not crash.
Fix shape
Find each holder or race at its cause. Name the cause before adding any retry or tolerance. For 4, catch the crashing file first (e.g. --reporter=verbose until it reproduces).
More load-only failures, each seen once, all passing in isolation. Across 14 full runs whose failures I could attribute:
tower-lifecycle.windows "bridge mode: a Tower bound to this machine's LAN address is stopped gracefully": timed out waiting for the bridge-mode Tower to answer on its LAN address (throwaway port, not 4100).
porch bugfix-1814-check-timeout "a protocol.json timeout_ms reaches the runner": expected 2607 to be less than 2500.
Counts for the items already listed here: metrics-model-id barrier 1/14, windows-job census 1/14, gitea-tea-api pagination 1/14, Worker exited unexpectedly 2/14 (only in the first two runs, and not seen in the 12 since).
Three more Windows flakes seen on 2026-11-20 while building #1911. None is caused by that change.
Local only, under full-suite load (never failed in the last 15 Windows CI runs):
src/commands/porch/__tests__/bugfix-1814-check-timeout.test.ts, "a protocol.json timeout_ms reaches the runner and kills the check at that value". Asserts a 0.3s-timeout check of sleep 3 ends in under 2500ms. Took 2574, 2690 and 3271ms in three loaded runs; passes 3/3 alone. On Windows the timeout kill is a process-tree snapshot followed by taskkill, two process launches that slow down under load. The 3271ms run means sleep 3 finished by itself before the kill landed. Suggested fix: use a longer sleep so a natural exit cannot pass for a kill, and loosen the bound on Windows. This one blocks porch's tests check when it trips.
launch-loop-exit-code.test.ts, "still auto-restarts after a crash". EPERM removing its temp directory (codev-1241-*). Passed on one re-run.
CI only (passes 3/3 locally):
src/__tests__/tower-lifecycle.windows.test.ts, scenario 5 (a row whose shellper pid was reused). Fails with read ECONNRESET. Seen on three branches: run 44237325105 (builder/bugfix-1922), run 44258108002 (builder/pir-1919), run 44725012668 (builder/pir-1911, passed on re-run of the job).
Activity
[Bugfix #1922] Test: bounded Windows retry for fake-CLI temp-dir remo…
amrmelsayed commentedon Nov 18, 2026
Update from #1922.
proc.killwithout awaiting the child'sclose, which tests: full suite on native Windows stops the live Tower and fails on main (launchers.windows port 4100, EPERM temp cleanup) #1922 left untouched.tower-lifecycle.windows"bridge mode: a Tower bound to this machine's LAN address is stopped gracefully":timed out waiting for the bridge-mode Tower to answer on its LAN address(throwaway port, not 4100).bugfix-1814-check-timeout"a protocol.json timeout_ms reaches the runner":expected 2607 to be less than 2500.tripwire-wiring"fires when the lane COMMITS": the stub claude'sgit committhrough Git Bash failed, then EPERM on its temp dir. It uses its own stub-claude, not the vitest harness fake, and passed 3/3 alone. It may share consult: agy-auth-cache tests hit EPERM on temp-dir cleanup under load on Windows; find the cause and re-enable #1925's cause.metrics-model-idbarrier 1/14,windows-jobcensus 1/14,gitea-tea-apipagination 1/14,Worker exited unexpectedly2/14 (only in the first two runs, and not seen in the 12 since).amrmelsayed commentedon Nov 22, 2026
Three more Windows flakes seen on 2026-11-20 while building #1911. None is caused by that change.
Local only, under full-suite load (never failed in the last 15 Windows CI runs):
src/commands/porch/__tests__/bugfix-1814-check-timeout.test.ts, "a protocol.json timeout_ms reaches the runner and kills the check at that value". Asserts a 0.3s-timeout check ofsleep 3ends in under 2500ms. Took 2574, 2690 and 3271ms in three loaded runs; passes 3/3 alone. On Windows the timeout kill is a process-tree snapshot followed bytaskkill, two process launches that slow down under load. The 3271ms run meanssleep 3finished by itself before the kill landed. Suggested fix: use a longer sleep so a natural exit cannot pass for a kill, and loosen the bound on Windows. This one blocks porch's tests check when it trips.launch-loop-exit-code.test.ts, "still auto-restarts after a crash". EPERM removing its temp directory (codev-1241-*). Passed on one re-run.CI only (passes 3/3 locally):
src/__tests__/tower-lifecycle.windows.test.ts, scenario 5 (a row whose shellper pid was reused). Fails withread ECONNRESET. Seen on three branches: run 44237325105 (builder/bugfix-1922), run 44258108002 (builder/pir-1919), run 44725012668 (builder/pir-1911, passed on re-run of the job).