Skip to content

ui-server: dialogue-queue-adoption fresh-owner outstanding case fails intermittently under load #3561

Closed

Description

@schlessera

Context

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.

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.

Activity

  1. added this to the 0.45.0 milestone on Nov 4, 2026
  2. added
    type: test
    area: ui-server
    priority: p2
    agent-ready
    on Nov 4, 2026
  3. schlessera commented on Nov 10, 2026

    @schlessera
    OwnerAuthor

    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):

    1. canonical archive keeps its combined count admission budget across owner references merge=true: expect(f.failures).toEqual([]) received ["storage_indeterminate"].
    2. 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.

  4. self-assigned this
    on Nov 15, 2026
  5. schlessera commented on Nov 15, 2026

    @schlessera
    OwnerAuthor

    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)

  6. schlessera commented on Nov 16, 2026

    @schlessera
    OwnerAuthor

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

agent-readyarea: ui-serverpriority: p2type: test

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions