ci flake: pendingLive seam reds on vi.waitFor's implicit 1 s default — the fixed clock #895 removed from settle(), back via waitFor #1249

Closed
opened 2026-09-06 01:51:41 +00:00 by matou-build-agent · 13 comments

Symptom

ci run 18624 (https://git.matou.nz/Matou/idss/actions/runs/18624) reddened the seam at
TypeScript: build (tsc), test (vitest), lint (eslint):

FAIL tests/unit/pendingLive.test.ts > the Fleet pending strip reads live from the real
control plane (acceptance 1) > the P2-S4 card fields are real control-plane data
AssertionError: expected false to be true  ❯ tests/unit/pendingLive.test.ts:110:70
Test Files  1 failed | 121 passed (122)     Tests  1 failed | 1408 passed (1409)

Accompanied on the same tail by DOMException [AbortError]: The operation was aborted.

Why this is a flake, not a regression

Run 18624 ran on 25d102a8. The previous green seam (run 18585, 2026-09-05 23:45) ran on
565bfc47. git diff --name-only 565bfc47 25d102a8 -- dashboard/ is empty — zero
dashboard files changed between the pass and the fail. The suite is byte-identical across
a green and a red. Same-code pass→fail = load-sensitive timing.

Root cause

dashboard/tests/unit/pendingLive.test.ts:108 gates the first card render on

await vi.waitFor(async () => {
  await flushPromises();
  expect(wrapper.find('[data-field="pending-device"]').exists()).toBe(true);
});

with no explicit timeout — so it rides vi.waitFor's default 1000 ms wall clock.
What has to fit in that budget is a real loopback HTTP round-trip (startControlPlane
boots a node:http server; httpPendingSource fetches through the generated client) plus
the Vue reactive re-render. Under seam CI load — pnpm -r run test forks ~15 vitest
workers, and host.txt at the time showed swap at 2388/4095 MB — that round-trip can
exceed 1 s. When it does, the awaited node has not rendered, the assertion reds on
expected false to be true, and happy-dom aborts the still-in-flight fetch on teardown,
which is the AbortError on the tail.

This is exactly the class tests/support/liveServer.ts already documents and fixed twice:
#882 and #888 both chased a symptom, and #895 established the rule — a condition wait,
not a clock
, so a slow host makes a live seam slower, never red. settleLive() exists
for precisely this and drains happy-dom's async task manager. vi.waitFor's default 1 s is
the same fixed clock #895 removed from settle(), reintroduced through the back door.

Scope — not one file

Every vi.waitFor in the live-server seams relies on the 1 s default:

  • tests/unit/pendingLive.test.ts:108
  • tests/unit/pendingActsLive.test.ts:126,134,144,173,181,190
  • tests/unit/enrollLive.test.ts:174,181,210,219

All 11 sites carry the same exposure. pendingLive reds first only because it is the one
that has to complete a cold mount fetch inside the budget.

Acceptance

  1. No live-server seam gates a real round-trip on vi.waitFor's implicit 1 s default —
    either route through settleLive() (the #895 condition wait) or pass an explicit
    load-tolerant { timeout } at every site listed above.
  2. The seam stays green when the dashboard suite runs under host load comparable to the
    swarm-pool seam job (~15 forked workers).
  3. No product code (dashboard/src/**) changes — the transport is not at fault.

Evidence

## Symptom `ci` run 18624 (https://git.matou.nz/Matou/idss/actions/runs/18624) reddened the seam at `TypeScript: build (tsc), test (vitest), lint (eslint)`: ``` FAIL tests/unit/pendingLive.test.ts > the Fleet pending strip reads live from the real control plane (acceptance 1) > the P2-S4 card fields are real control-plane data AssertionError: expected false to be true ❯ tests/unit/pendingLive.test.ts:110:70 Test Files 1 failed | 121 passed (122) Tests 1 failed | 1408 passed (1409) ``` Accompanied on the same tail by `DOMException [AbortError]: The operation was aborted.` ## Why this is a flake, not a regression Run 18624 ran on `25d102a8`. The previous green seam (run 18585, 2026-09-05 23:45) ran on `565bfc47`. `git diff --name-only 565bfc47 25d102a8 -- dashboard/` is **empty** — zero dashboard files changed between the pass and the fail. The suite is byte-identical across a green and a red. Same-code pass→fail = load-sensitive timing. ## Root cause `dashboard/tests/unit/pendingLive.test.ts:108` gates the first card render on ```ts await vi.waitFor(async () => { await flushPromises(); expect(wrapper.find('[data-field="pending-device"]').exists()).toBe(true); }); ``` with **no explicit timeout** — so it rides `vi.waitFor`'s default **1000 ms** wall clock. What has to fit in that budget is a *real* loopback HTTP round-trip (`startControlPlane` boots a `node:http` server; `httpPendingSource` fetches through the generated client) plus the Vue reactive re-render. Under seam CI load — `pnpm -r run test` forks ~15 vitest workers, and `host.txt` at the time showed swap at 2388/4095 MB — that round-trip can exceed 1 s. When it does, the awaited node has not rendered, the assertion reds on `expected false to be true`, and happy-dom aborts the still-in-flight fetch on teardown, which is the `AbortError` on the tail. This is exactly the class `tests/support/liveServer.ts` already documents and fixed twice: #882 and #888 both chased a symptom, and **#895** established the rule — *a condition wait, not a clock*, so a slow host makes a live seam **slower, never red**. `settleLive()` exists for precisely this and drains happy-dom's async task manager. `vi.waitFor`'s default 1 s is the same fixed clock #895 removed from `settle()`, reintroduced through the back door. ## Scope — not one file Every `vi.waitFor` in the live-server seams relies on the 1 s default: - `tests/unit/pendingLive.test.ts:108` - `tests/unit/pendingActsLive.test.ts:126,134,144,173,181,190` - `tests/unit/enrollLive.test.ts:174,181,210,219` All 11 sites carry the same exposure. `pendingLive` reds first only because it is the one that has to complete a cold mount fetch inside the budget. ## Acceptance 1. No live-server seam gates a real round-trip on `vi.waitFor`'s implicit 1 s default — either route through `settleLive()` (the #895 condition wait) or pass an explicit load-tolerant `{ timeout }` at every site listed above. 2. The seam stays green when the dashboard suite runs under host load comparable to the `swarm`-pool seam job (~15 forked workers). 3. No product code (`dashboard/src/**`) changes — the transport is not at fault. ## Evidence - Failing run: https://git.matou.nz/Matou/idss/actions/runs/18624 - Heal signature `41caf9190ae5`, heal run `heal-Matou-idss-1788659291-3256512` - Filed by the swarm healer; classified product-class (dashboard test code), no repair attempted.
Author
Member

swarm-claim host=matou-dev-server-01 run=18630
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=matou-dev-server-01 run=18630 (automated multi-host claim — lowest live claim id works this ticket)
Author
Member

swarm-claim host=matou-dev-server-01 run=18630
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=matou-dev-server-01 run=18630 (automated multi-host claim — lowest live claim id works this ticket)
Author
Member

swarm-claim host=matou-dev-server-01 run=18642
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=matou-dev-server-01 run=18642 (automated multi-host claim — lowest live claim id works this ticket)
Author
Member

swarm-claim host=matou-dev-server-01 run=18651
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=matou-dev-server-01 run=18651 (automated multi-host claim — lowest live claim id works this ticket)
Author
Member

swarm-claim host=elitebook-distributed-server-03 run=18652
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=elitebook-distributed-server-03 run=18652 (automated multi-host claim — lowest live claim id works this ticket)
Author
Member

swarm-claim host=elitebook-distributed-server-03 run=18652
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=elitebook-distributed-server-03 run=18652 (automated multi-host claim — lowest live claim id works this ticket)
Author
Member

swarm-claim host=matou-dev-server-01 run=18660
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=matou-dev-server-01 run=18660 (automated multi-host claim — lowest live claim id works this ticket)
Author
Member

swarm-claim host=matou-dev-server-01 run=18661
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=matou-dev-server-01 run=18661 (automated multi-host claim — lowest live claim id works this ticket)
Author
Member

swarm-claim host=elitebook-distributed-server-03 run=18661
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=elitebook-distributed-server-03 run=18661 (automated multi-host claim — lowest live claim id works this ticket)
Author
Member

swarm-claim host=elitebook-distributed-server-03 run=18661
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=elitebook-distributed-server-03 run=18661 (automated multi-host claim — lowest live claim id works this ticket)
Author
Member

swarm-claim host=elitebook-distributed-server-03 run=18661
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=elitebook-distributed-server-03 run=18661 (automated multi-host claim — lowest live claim id works this ticket)
Author
Member

swarm-claim host=matou-dev-server-01 run=18661
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=matou-dev-server-01 run=18661 (automated multi-host claim — lowest live claim id works this ticket)
Author
Member

close-report for #1249 — status success

✅ close-report gates passed — every claim verified against main; issue closed.

envelope
{
  "issue": 1249,
  "status": "success",
  "commits": [
    "d47b2ff9e752723bb7fc3d858000fc2b584670af"
  ],
  "changed_files": [
    "dashboard/tests/support/liveServer.ts",
    "dashboard/tests/unit/pendingLive.test.ts",
    "dashboard/tests/unit/pendingActsLive.test.ts",
    "dashboard/tests/unit/enrollLive.test.ts"
  ],
  "tests": [
    {
      "command": "npx vitest run tests/unit/pendingLive.test.ts tests/unit/pendingActsLive.test.ts tests/unit/enrollLive.test.ts",
      "exit_code": 0
    },
    {
      "command": "npx vitest run (full dashboard suite, 1409 tests)",
      "exit_code": 0
    },
    {
      "command": "npx vue-tsc -p tsconfig.json --noEmit",
      "exit_code": 0
    },
    {
      "command": "npx eslint tests/unit/{pendingLive,pendingActsLive,enrollLive}.test.ts tests/support/liveServer.ts",
      "exit_code": 0
    }
  ],
  "criteria": {
    "1. No live-server seam gates a real round-trip on vi.waitFor's implicit 1 s default — either route through settleLive() or pass an explicit load-tolerant { timeout } at every site listed": "pendingLive:108, pendingActsLive:126,173 now use settleLive() (the #895 unbounded condition drain); pendingActsLive:134,144,181,190 and enrollLive:174,181,210,219 each pass { timeout: LIVE_WAITFOR_TIMEOUT_MS } (10 s, exported from tests/support/liveServer.ts). grep confirms zero vi.waitFor rides the implicit default across the three files (commit d47b2ff9).",
    "2. The seam stays green when the dashboard suite runs under host load comparable to ~15 forked workers": "Removing the 1 s clock is structural; verified the three seams green under 6-way CPU pressure (yes >/dev/null x6) and testTimeout raised to 30 s in the two files that chain two poll-advance waits so their sum clears vitest's 5 s default.",
    "3. No product code (dashboard/src/**) changes — the transport is not at fault": "git diff --stat shows only dashboard/tests/** changed (liveServer.ts + 3 seam test files); dashboard/src/** untouched."
  },
  "summary": "Every live-server seam's vi.waitFor now rides the #895 condition drain or a shared 10 s load-tolerant ceiling instead of the implicit 1 s clock, so a loaded seam host makes the strip slower, never red.",
  "blockers": []
}
**close-report** for #1249 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 1249, "status": "success", "commits": [ "d47b2ff9e752723bb7fc3d858000fc2b584670af" ], "changed_files": [ "dashboard/tests/support/liveServer.ts", "dashboard/tests/unit/pendingLive.test.ts", "dashboard/tests/unit/pendingActsLive.test.ts", "dashboard/tests/unit/enrollLive.test.ts" ], "tests": [ { "command": "npx vitest run tests/unit/pendingLive.test.ts tests/unit/pendingActsLive.test.ts tests/unit/enrollLive.test.ts", "exit_code": 0 }, { "command": "npx vitest run (full dashboard suite, 1409 tests)", "exit_code": 0 }, { "command": "npx vue-tsc -p tsconfig.json --noEmit", "exit_code": 0 }, { "command": "npx eslint tests/unit/{pendingLive,pendingActsLive,enrollLive}.test.ts tests/support/liveServer.ts", "exit_code": 0 } ], "criteria": { "1. No live-server seam gates a real round-trip on vi.waitFor's implicit 1 s default — either route through settleLive() or pass an explicit load-tolerant { timeout } at every site listed": "pendingLive:108, pendingActsLive:126,173 now use settleLive() (the #895 unbounded condition drain); pendingActsLive:134,144,181,190 and enrollLive:174,181,210,219 each pass { timeout: LIVE_WAITFOR_TIMEOUT_MS } (10 s, exported from tests/support/liveServer.ts). grep confirms zero vi.waitFor rides the implicit default across the three files (commit d47b2ff9).", "2. The seam stays green when the dashboard suite runs under host load comparable to ~15 forked workers": "Removing the 1 s clock is structural; verified the three seams green under 6-way CPU pressure (yes >/dev/null x6) and testTimeout raised to 30 s in the two files that chain two poll-advance waits so their sum clears vitest's 5 s default.", "3. No product code (dashboard/src/**) changes — the transport is not at fault": "git diff --stat shows only dashboard/tests/** changed (liveServer.ts + 3 seam test files); dashboard/src/** untouched." }, "summary": "Every live-server seam's vi.waitFor now rides the #895 condition drain or a shared 10 s load-tolerant ceiling instead of the implicit 1 s clock, so a loaded seam host makes the strip slower, never red.", "blockers": [] } ``` </details>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Matou/idss#1249
No description provided.