Repository navigation
Description
What happened
internal/session's TestAWindowOneStallClosedIsDecidedByThePosture/left_running_with_a_ceiling
fails on a loaded box. Measured 2026-09-10 on dev@64dc75f28 (macOS, 10 cores, eight
busy-loops running beside it). It is not caused by the change that found it — the same
binary built from 64dc75f28 and from a branch on top of it fail at the same rate in
alternating rounds:
--- FAIL: TestAWindowOneStallClosedIsDecidedByThePosture (1.49s)
--- FAIL: TestAWindowOneStallClosedIsDecidedByThePosture/left_running_with_a_ceiling (0.62s)
unattendeddoor_test.go:1097: the landing is missing "without answering and was abandoned":
Wrote greet.go with the greeting.
taken as it stands: nobody could check it — asked twice, and neither call answered — nobody could check it in 40ms, and the run is unattended
The test asks for a landing that carries checkerStalled — "one call ran without
answering and was abandoned" — because the run it builds hangs both checking calls inside a
40ms window, and the first is meant to be abandoned at its own bound with the second asked
after it. Under load the landing carries checkerAskedTwice instead: both calls were made,
neither answered, no call is reported as having held its bound. Everything else the subtest
asserts is present, including checkerWindowClosed and checkerRanOut.
This is the shape AGENTS.md says is a bug report rather than a known shape — it fails only
when other work is running beside it — so it is filed rather than rerun in isolation. It is
NOT in .github/known-red.txt and must not be added to it.
Replication
Deterministic (no model). The test's own completer is a stub; only the clock is real.
for i in $(seq 1 8); do (while :; do :; done) & done # load the box
go test -count=15 -run 'TestAWindowOneStallClosedIsDecidedByThePosture' ./internal/session
kill %1 %2 %3 %4 %5 %6 %7 %8On an unloaded laptop this is green at -count=15. Loaded, it failed 1 in 10 runs in two of
six alternating rounds (three rounds each of dev@64dc75f28 and a branch on top of it,
prebuilt with go test -c so compilation was not part of the measurement). The failure is
the block quoted above.
Field (real models). None needed — no key, no network, no cost. The window under test is
config.auditWindow = 40 * time.Millisecond, set by the test itself.
Where
internal/session/unattendeddoor_test.go, TestAWindowOneStallClosedIsDecidedByThePosture
(search left running with a ceiling).
The two sentences that race are in internal/session/task_audit.go: checkerStalled
("without answering and was abandoned") and checkerAskedTwice ("nobody could check it —
asked twice, and neither call answered"). Which one lands is decided in Agent.auditNode
and auditPace — a call is said to have stalled when it held its whole bound, and under
load the first attempt's bound and the 40ms window expire close enough together that the
run reaches the second landing instead.
The fix
A person reading either landing is told the truth, so the wording is not what is wrong. What
is wrong is that a 40ms window makes the two accounts a race: the per-call bound is derived
from the window, and at 40ms the difference between "this call held its bound" and "the
window closed under it" is a few milliseconds of scheduler jitter.
Either the test drives the pace from a deterministic clock instead of the wall (the
repository's preference — see docs/changes/unreleased/798-test-harness-clock.md), or the
subtest asserts the family of landings that are correct for a window that closed across two
hung calls rather than the one that happens to win on an idle box. Whichever is chosen, the
watched half of the test — which asserts TaskUnverified and the your-call lead — is
unaffected and must keep passing.
Acceptance
- e2e:
go test -count=20 -run 'TestAWindowOneStallClosedIsDecidedByThePosture' ./internal/sessionis green with eight busy-loops running beside it, and the
left running with a ceilingsubtest's landing still containscheckerWindowClosedand
checkerRanOutand still does not lead withyourCallLead. - e2e: the
watchedsubtest still reachesTaskUnverifiedwith the report leading with
yourCallLead(notice.StatusFacts())— the posture, not the timing, is what decides it. - Unit: whatever bounds a checking call is derived from the window in ONE place, so a
window and a bound cannot be compared by two rules that disagree at small values. - No manual page states this: the wording a person reads is unchanged either way, and no
documented limit moves..github/known-red.txtgains nothing — the ledger only shrinks.
Drafted with CodeAF · reviewed and owned by the author
Activity
santoshkumarradha commentedon Sep 10, 2026
Consolidated into #814 — a test's verdict is about the code, never about the box. This issue's evidence, replication and fix shape are reproduced there in full under its family heading, alongside the eight others that share its law; the lane that takes #814 takes this. Nothing is lost — this issue stays readable and #814 links back to it.
Closed as part of the 2026-09-10 triage sweep, which folded nine separately-filed load-, path- and order-dependent test failures into one piece of work. Verified at dev@95a0d0a9b that this one is still live.
fix: manual section chrome, #803 stall race, e2e-tui 40m budget (#822)