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
ui-server: dialogue-queue-adoption fresh-owner outstanding case fails intermittently under load #3561
agent-readyContext and acceptance criteria are complete enough for an agent to take this unattended.area: ui-serverHono app factory: turn coordinator, auth, session catalog, routes, cron.priority: p2Wanted, not scheduled. Pulled in when a milestone has room.type: testCoverage, harness or proof work with no behaviour change.
On 2026-11-04, while verifying #3557, a worker saw packages/ui-server/tests/dialogue-queue-adoption.test.ts fail intermittently in the "fresh-owner … outstanding=true" case.
Combined runs under load: it failed in 2 of 5 local runs.
This is filed so the case is not lost. It may be another load-sensitive wait, of the same kind as #3263, #3550 and #3553.
Acceptance criteria
Reproduce the failure deterministically, by forcing the ordering it depends on under load, and record the failing assertion.
Find the race and fix the real cause, whether in the product or in a test wait that observes too early. Follow docs/process/test-waits.md. Do not weaken any assertion or remove the case.
Prove the fix with repeated runs under load and a mutation check.
Reproduced on 2026-11-10 during a test-health audit (run th-20261110163814-571eb3, cluster 5), at commit a267a06ec on the batch branch.
What I ran
bun scripts/test-health.ts measure packages/ui-server/tests/dialogue-queue-adoption.test.ts --runs 10 --shuffle --stress with the host already at load average 36 to 68.
Result: 2 failures in 30 runs (flaky). An unstressed baseline of 10 in-order and shuffled runs, plus 3 runs with neighbouring files, passed every time.
The failing assertions (neither is the outstanding=true cell this issue names, so this is not one cell's problem):
canonical archive keeps its combined count admission budget across owner references merge=true: expect(f.failures).toEqual([]) received ["storage_indeterminate"].
fresh-owner inactive-bind shares count admission with its canonical target outstanding=false: expect(f.pages.flatMap(...).map(row => row.evidence)).toEqual(expected) was missing the trailing backend records. The pages stopped being published part way through.
Cause (test fault)
Every write the journal tracks is also wrapped in the real 10 s storage budget: track calls withinStorageBudget (packages/ui-server/src/ws/dialogue.ts:342-355, STORAGE_SETTLEMENT_MS, packages/ui-server/src/db/settlement.ts:2-16). The test holds the write worker on purpose (f.hold()) while it submits writes until it reaches maxPendingDialogueObservations. Under load, the time between the first held write and f.release() passes 10 s; these cells take about 9.5 s each even unstressed. The budget then fires, reports storage_indeterminate, and withholdOwner stops publishing pages. Both observed failures follow from that.
The product is behaving as documented: a write held past its budget is indeterminate. The test is wrong to let a real 10 s deadline run during a hold whose length depends on load. One possible fix, test-only: install storageDeadlineClock() (packages/ui-server/tests/helpers/storage-deadline-clock.ts) for the held window, or a variant of it that does not let the real timer fire. Then prove it with 10+ runs under --stress and a mutation. I have not applied that fix in this run, because there was not enough time left to produce the stress proof.
Merged in #4062 as e19300f12 through the integration lease (orchestrator merge queue for 0.45.0). Candidate confirmation passed on the exact head; the squash's own main run carries the post-merge heavy categories.
agent-readyContext and acceptance criteria are complete enough for an agent to take this unattended.area: ui-serverHono app factory: turn coordinator, auth, session catalog, routes, cron.priority: p2Wanted, not scheduled. Pulled in when a milestone has room.type: testCoverage, harness or proof work with no behaviour change.
Activity
schlessera commentedon Nov 10, 2026
Reproduced on 2026-11-10 during a test-health audit (run
th-20261110163814-571eb3, cluster 5), at commita267a06econ the batch branch.What I ran
bun scripts/test-health.ts measure packages/ui-server/tests/dialogue-queue-adoption.test.ts --runs 10 --shuffle --stresswith the host already at load average 36 to 68.flaky). An unstressed baseline of 10 in-order and shuffled runs, plus 3 runs with neighbouring files, passed every time.The failing assertions (neither is the
outstanding=truecell this issue names, so this is not one cell's problem):canonical archive keeps its combined count admission budget across owner references merge=true:expect(f.failures).toEqual([])received["storage_indeterminate"].fresh-owner inactive-bind shares count admission with its canonical target outstanding=false:expect(f.pages.flatMap(...).map(row => row.evidence)).toEqual(expected)was missing the trailing backend records. The pages stopped being published part way through.Cause (test fault)
Every write the journal tracks is also wrapped in the real 10 s storage budget:
trackcallswithinStorageBudget(packages/ui-server/src/ws/dialogue.ts:342-355,STORAGE_SETTLEMENT_MS,packages/ui-server/src/db/settlement.ts:2-16). The test holds the write worker on purpose (f.hold()) while it submits writes until it reachesmaxPendingDialogueObservations. Under load, the time between the first held write andf.release()passes 10 s; these cells take about 9.5 s each even unstressed. The budget then fires, reportsstorage_indeterminate, andwithholdOwnerstops publishing pages. Both observed failures follow from that.The product is behaving as documented: a write held past its budget is indeterminate. The test is wrong to let a real 10 s deadline run during a hold whose length depends on load. One possible fix, test-only: install
storageDeadlineClock()(packages/ui-server/tests/helpers/storage-deadline-clock.ts) for the held window, or a variant of it that does not let the real timer fire. Then prove it with 10+ runs under--stressand a mutation. I have not applied that fix in this run, because there was not enough time left to produce the stress proof.schlessera commentedon Nov 15, 2026
Claimed for implementation. Claim token:
claim-bfe820db. Branch:test/3561-queue-adoption-storage-budget.collisions: closure-only (22 open PRs touching ui-server; none edits the test file directly)
test(ui-server): keep the real storage budget out of queue-adoption h…
schlessera commentedon Nov 16, 2026
Merged in #4062 as
e19300f12through the integration lease (orchestrator merge queue for 0.45.0). Candidate confirmation passed on the exact head; the squash's own main run carries the post-merge heavy categories.