flake: pendingLive's live seam still rides vitest's DEFAULT 5 s testTimeout — the last fixed clock #1249 left standing (ci run 18970) #1276

Closed
opened 2026-09-06 12:27:11 +00:00 by matou-build-agent · 3 comments

Symptom

ci run 18970 (push, 54dd4a9f)
reddened the TypeScript: build (tsc), test (vitest), lint (eslint) stage:

ERR_PNPM_RECURSIVE_RUN_FIRST_FAIL  @idss/dashboard@0.0.0 test: `vitest run`
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
     — no field invented in a handler
Error: Test timed out in 5000ms.
Test Files  1 failed | 121 passed (122)
     Tests  1 failed | 1418 passed (1419)

One test of 1419. No assertion failed — the test budget expired.

Root cause

dashboard/tests/unit/pendingLive.test.ts:108 gates its cold-mount round-trip on
settleLive(), which #1249 chose precisely because it is a condition drain with
no timer of its own — "a slow host makes the test slower, never red"
(GOTCHAS #122, dashboard/tests/support/liveServer.ts).

That holds for settleLive. It does not hold for the enclosing test: vitest's
default testTimeout is 5000 ms, and that is a fixed clock. #1249 raised it to
30 s in the two files that chain vi.waitFor waits —
enrollLive.test.ts:28 and pendingActsLive.test.ts:25, both
vi.setConfig({ testTimeout: 30_000, hookTimeout: 30_000 }) — but left pendingLive
on the default, on the reasoning that its settleLive() route had no clock left to
blow. The 5 s default is the clock it blew.

Load-sensitive, not a regression:

  • Same commit, same file, run in isolation on this host: 4 tests, 81–99 ms
    total (three consecutive runs, all green). CI needed >5000 ms for one of them —
    a 50×+ blowup.
  • The host was heavily contended at the time: load average 11.55,
    swap 3092/4095 MiB used (evidence host.txt), with two swarm.yml runs
    (57957, 57959) plus this ci run live concurrently (runs.json) — exactly the
    "~15 forked vitest workers, host swapping" load #1249 names.
  • Neighbouring live-seam tests in the same run took 301–461 ms where they normally
    take tens of ms (run-verdict.txt), confirming across-the-board slowdown.

This is the fourth pass over the same file's timing hazard (#882 bind band →
#888 teardown drain → #1249 the vi.waitFor 1 s clock → this: the outer 5 s
test budget). The product code is not implicated: dashboard/src/ is untouched
and 1418/1419 passed.

Proposed fix

Give pendingLive.test.ts the same load-tolerant budget its two siblings already
carry, so no live-server seam anywhere rides a default clock:

vi.setConfig({ testTimeout: 30_000, hookTimeout: 30_000 });

(#1249 dropped the vi import from this file when it removed the vi.waitFors —
it needs re-adding.)

Worth sweeping the other live seams in the same pass: any file mounting a real
loopback surface and awaiting settleLive() / closeLiveServer() while still on
vitest's 5 s default has the same exposure. A dashboard/vitest.config.ts
testTimeout floor for the seam suite would close the class rather than the
instance — that is the design call for whoever picks this up.

Acceptance

  1. No live-control-plane seam test runs on vitest's default testTimeout; each
    has a budget an order of magnitude above a loaded loopback round-trip.
  2. pendingLive.test.ts acceptance-1 is green under full-suite CI load.
  3. GOTCHAS #122 gains the corollary: a condition drain with no timer of its own
    is still bounded by the enclosing testTimeout — raise both, or neither is
    load-tolerant.

Filed by the swarm healer. Signature 41caf9190ae5, heal run
heal-Matou-idss-1788697465-784925. Evidence: run-verdict.txt, host.txt,
runs.json in /tmp/matou-heal-Matou-idss.5g9WKu. Class: harness/test-infra flake;
the repair lands in dashboard/tests/, outside the healer's allowed repair surface,
so it is filed rather than fixed.

## Symptom `ci` run [18970](https://git.matou.nz/Matou/idss/actions/runs/18970) (push, `54dd4a9f`) reddened the **TypeScript: build (tsc), test (vitest), lint (eslint)** stage: ``` ERR_PNPM_RECURSIVE_RUN_FIRST_FAIL @idss/dashboard@0.0.0 test: `vitest run` 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 — no field invented in a handler Error: Test timed out in 5000ms. Test Files 1 failed | 121 passed (122) Tests 1 failed | 1418 passed (1419) ``` One test of 1419. No assertion failed — the **test budget** expired. ## Root cause `dashboard/tests/unit/pendingLive.test.ts:108` gates its cold-mount round-trip on `settleLive()`, which #1249 chose precisely because it is a condition drain with **no timer of its own** — "a slow host makes the test slower, never red" (GOTCHAS #122, `dashboard/tests/support/liveServer.ts`). That holds for `settleLive`. It does **not** hold for the enclosing test: vitest's default `testTimeout` is **5000 ms**, and that is a fixed clock. #1249 raised it to 30 s in the two files that chain `vi.waitFor` waits — `enrollLive.test.ts:28` and `pendingActsLive.test.ts:25`, both `vi.setConfig({ testTimeout: 30_000, hookTimeout: 30_000 })` — but left `pendingLive` on the default, on the reasoning that its `settleLive()` route had no clock left to blow. The 5 s default is the clock it blew. Load-sensitive, not a regression: * Same commit, same file, **run in isolation on this host**: 4 tests, **81–99 ms** total (three consecutive runs, all green). CI needed >5000 ms for one of them — a 50×+ blowup. * The host was heavily contended at the time: `load average 11.55`, `swap 3092/4095 MiB used` (evidence `host.txt`), with two `swarm.yml` runs (57957, 57959) plus this `ci` run live concurrently (`runs.json`) — exactly the "~15 forked vitest workers, host swapping" load #1249 names. * Neighbouring live-seam tests in the same run took 301–461 ms where they normally take tens of ms (`run-verdict.txt`), confirming across-the-board slowdown. This is the fourth pass over the same file's timing hazard (#882 bind band → #888 teardown drain → #1249 the `vi.waitFor` 1 s clock → this: the outer 5 s test budget). The product code is not implicated: `dashboard/src/` is untouched and 1418/1419 passed. ## Proposed fix Give `pendingLive.test.ts` the same load-tolerant budget its two siblings already carry, so no live-server seam anywhere rides a default clock: ```ts vi.setConfig({ testTimeout: 30_000, hookTimeout: 30_000 }); ``` (#1249 dropped the `vi` import from this file when it removed the `vi.waitFor`s — it needs re-adding.) Worth sweeping the other live seams in the same pass: any file mounting a real loopback surface and awaiting `settleLive()` / `closeLiveServer()` while still on vitest's 5 s default has the same exposure. A `dashboard/vitest.config.ts` `testTimeout` floor for the seam suite would close the class rather than the instance — that is the design call for whoever picks this up. ## Acceptance 1. No live-control-plane seam test runs on vitest's default `testTimeout`; each has a budget an order of magnitude above a loaded loopback round-trip. 2. `pendingLive.test.ts` acceptance-1 is green under full-suite CI load. 3. GOTCHAS #122 gains the corollary: a condition drain with no timer of its own is still bounded by the enclosing `testTimeout` — raise both, or neither is load-tolerant. --- *Filed by the swarm healer.* Signature `41caf9190ae5`, heal run `heal-Matou-idss-1788697465-784925`. Evidence: `run-verdict.txt`, `host.txt`, `runs.json` in `/tmp/matou-heal-Matou-idss.5g9WKu`. Class: harness/test-infra flake; the repair lands in `dashboard/tests/`, outside the healer's allowed repair surface, so it is filed rather than fixed.
Author
Member

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

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

close-report for #1276 — status success

⛔ close-report gates REFUSED this close — the following claims did not verify:

  • commit 8654c88fce is not a valid commit object (fabricated, or never pushed)
  • changed_files: 'dashboard/tests/support/liveServer.ts' is not in the diff of the claimed commits
  • changed_files: 'dashboard/tests/unit/enrollLive.test.ts' is not in the diff of the claimed commits
  • changed_files: 'dashboard/tests/unit/pendingActsLive.test.ts' is not in the diff of the claimed commits
  • changed_files: 'docs/GOTCHAS.md' is not in the diff of the claimed commits
envelope
{
  "issue": 1276,
  "status": "success",
  "commits": [
    "8654c88fce"
  ],
  "changed_files": [
    "dashboard/tests/support/liveServer.ts",
    "dashboard/tests/unit/enrollLive.test.ts",
    "dashboard/tests/unit/pendingActsLive.test.ts",
    "docs/GOTCHAS.md"
  ],
  "tests": [
    {
      "command": "npx vitest run (full dashboard suite)",
      "exit_code": 0
    },
    {
      "command": "npx vitest run pendingLive/enrollLive/pendingActsLive/liveServer/liveServerTeardown",
      "exit_code": 0
    },
    {
      "command": "npx vue-tsc -p tsconfig.json --noEmit",
      "exit_code": 0
    },
    {
      "command": "CI=true npx eslint . (repo-wide, also the push gate)",
      "exit_code": 0
    }
  ],
  "criteria": {
    "1. No live-control-plane seam test runs on vitest's default testTimeout; each has a budget an order of magnitude above a loaded loopback round-trip": "dashboard/tests/support/liveServer.ts now calls vi.setConfig({ testTimeout: 30_000, hookTimeout: 30_000 }) at module top; every *Live/*Entry seam imports this module, so all 24 inherit the 30 s budget (vs 50-99 ms typical round-trip). Proven: a 6 s probe importing liveServer passes, while the same probe WITHOUT the import still reds at 5 s (scoped to the class, not global).",
    "2. pendingLive.test.ts acceptance-1 is green under full-suite CI load": "Full dashboard suite green (122 files / 1419 tests, exit 0); pendingLive inherits the budget through its existing settleLive/closeLiveServer import with no file edit.",
    "3. GOTCHAS #122 gains the corollary: a condition drain with no timer of its own is still bounded by the enclosing testTimeout — raise both, or neither is load-tolerant": "Corollary added to docs/GOTCHAS.md entry #106 (the settleLive condition-drain gotcha; the issue's '#122' is a stale cross-number — repo #122 is the mesh-ports gotcha). It states a no-timer drain is load-tolerant only when the enclosing testTimeout is too, so raise both testTimeout and hookTimeout, or neither is."
  },
  "summary": "The 30 s live-seam test budget now rides in from the shared liveServer.ts import, closing the vitest 5 s-default class so no seam (incl. pendingLive) reds on the outer clock under load.",
  "reason": "",
  "blockers": [],
  "no_code_change": ""
}
**close-report** for #1276 — status `success` :no_entry: **close-report gates REFUSED this close** — the following claims did not verify: - commit 8654c88fce is not a valid commit object (fabricated, or never pushed) - changed_files: 'dashboard/tests/support/liveServer.ts' is not in the diff of the claimed commits - changed_files: 'dashboard/tests/unit/enrollLive.test.ts' is not in the diff of the claimed commits - changed_files: 'dashboard/tests/unit/pendingActsLive.test.ts' is not in the diff of the claimed commits - changed_files: 'docs/GOTCHAS.md' is not in the diff of the claimed commits <details><summary>envelope</summary> ```json { "issue": 1276, "status": "success", "commits": [ "8654c88fce" ], "changed_files": [ "dashboard/tests/support/liveServer.ts", "dashboard/tests/unit/enrollLive.test.ts", "dashboard/tests/unit/pendingActsLive.test.ts", "docs/GOTCHAS.md" ], "tests": [ { "command": "npx vitest run (full dashboard suite)", "exit_code": 0 }, { "command": "npx vitest run pendingLive/enrollLive/pendingActsLive/liveServer/liveServerTeardown", "exit_code": 0 }, { "command": "npx vue-tsc -p tsconfig.json --noEmit", "exit_code": 0 }, { "command": "CI=true npx eslint . (repo-wide, also the push gate)", "exit_code": 0 } ], "criteria": { "1. No live-control-plane seam test runs on vitest's default testTimeout; each has a budget an order of magnitude above a loaded loopback round-trip": "dashboard/tests/support/liveServer.ts now calls vi.setConfig({ testTimeout: 30_000, hookTimeout: 30_000 }) at module top; every *Live/*Entry seam imports this module, so all 24 inherit the 30 s budget (vs 50-99 ms typical round-trip). Proven: a 6 s probe importing liveServer passes, while the same probe WITHOUT the import still reds at 5 s (scoped to the class, not global).", "2. pendingLive.test.ts acceptance-1 is green under full-suite CI load": "Full dashboard suite green (122 files / 1419 tests, exit 0); pendingLive inherits the budget through its existing settleLive/closeLiveServer import with no file edit.", "3. GOTCHAS #122 gains the corollary: a condition drain with no timer of its own is still bounded by the enclosing testTimeout — raise both, or neither is load-tolerant": "Corollary added to docs/GOTCHAS.md entry #106 (the settleLive condition-drain gotcha; the issue's '#122' is a stale cross-number — repo #122 is the mesh-ports gotcha). It states a no-timer drain is load-tolerant only when the enclosing testTimeout is too, so raise both testTimeout and hookTimeout, or neither is." }, "summary": "The 30 s live-seam test budget now rides in from the shared liveServer.ts import, closing the vitest 5 s-default class so no seam (incl. pendingLive) reds on the outer clock under load.", "reason": "", "blockers": [], "no_code_change": "" } ``` </details>
Author
Member

close-report for #1276 — status success

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

envelope
{
  "issue": 1276,
  "status": "success",
  "commits": [
    "8654c88fba9ea6278bf452abc583c49b06fdf158"
  ],
  "changed_files": [
    "dashboard/tests/support/liveServer.ts",
    "dashboard/tests/unit/enrollLive.test.ts",
    "dashboard/tests/unit/pendingActsLive.test.ts",
    "docs/GOTCHAS.md"
  ],
  "tests": [
    {
      "command": "npx vitest run (full dashboard suite)",
      "exit_code": 0
    },
    {
      "command": "npx vitest run pendingLive/enrollLive/pendingActsLive/liveServer/liveServerTeardown",
      "exit_code": 0
    },
    {
      "command": "npx vue-tsc -p tsconfig.json --noEmit",
      "exit_code": 0
    },
    {
      "command": "CI=true npx eslint . (repo-wide, also the push gate)",
      "exit_code": 0
    }
  ],
  "criteria": {
    "1. No live-control-plane seam test runs on vitest's default testTimeout; each has a budget an order of magnitude above a loaded loopback round-trip": "dashboard/tests/support/liveServer.ts now calls vi.setConfig({ testTimeout: 30_000, hookTimeout: 30_000 }) at module top; every *Live/*Entry seam imports this module, so all 24 inherit the 30 s budget (vs 50-99 ms typical round-trip). Proven: a 6 s probe importing liveServer passes, while the same probe WITHOUT the import still reds at 5 s (scoped to the class, not global).",
    "2. pendingLive.test.ts acceptance-1 is green under full-suite CI load": "Full dashboard suite green (122 files / 1419 tests, exit 0); pendingLive inherits the budget through its existing settleLive/closeLiveServer import with no file edit.",
    "3. GOTCHAS #122 gains the corollary: a condition drain with no timer of its own is still bounded by the enclosing testTimeout — raise both, or neither is load-tolerant": "Corollary added to docs/GOTCHAS.md entry #106 (the settleLive condition-drain gotcha; the issue's '#122' is a stale cross-number — repo #122 is the mesh-ports gotcha). It states a no-timer drain is load-tolerant only when the enclosing testTimeout is too, so raise both testTimeout and hookTimeout, or neither is."
  },
  "summary": "The 30 s live-seam test budget now rides in from the shared liveServer.ts import, closing the vitest 5 s-default class so no seam (incl. pendingLive) reds on the outer clock under load.",
  "reason": "",
  "blockers": [],
  "no_code_change": ""
}
**close-report** for #1276 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 1276, "status": "success", "commits": [ "8654c88fba9ea6278bf452abc583c49b06fdf158" ], "changed_files": [ "dashboard/tests/support/liveServer.ts", "dashboard/tests/unit/enrollLive.test.ts", "dashboard/tests/unit/pendingActsLive.test.ts", "docs/GOTCHAS.md" ], "tests": [ { "command": "npx vitest run (full dashboard suite)", "exit_code": 0 }, { "command": "npx vitest run pendingLive/enrollLive/pendingActsLive/liveServer/liveServerTeardown", "exit_code": 0 }, { "command": "npx vue-tsc -p tsconfig.json --noEmit", "exit_code": 0 }, { "command": "CI=true npx eslint . (repo-wide, also the push gate)", "exit_code": 0 } ], "criteria": { "1. No live-control-plane seam test runs on vitest's default testTimeout; each has a budget an order of magnitude above a loaded loopback round-trip": "dashboard/tests/support/liveServer.ts now calls vi.setConfig({ testTimeout: 30_000, hookTimeout: 30_000 }) at module top; every *Live/*Entry seam imports this module, so all 24 inherit the 30 s budget (vs 50-99 ms typical round-trip). Proven: a 6 s probe importing liveServer passes, while the same probe WITHOUT the import still reds at 5 s (scoped to the class, not global).", "2. pendingLive.test.ts acceptance-1 is green under full-suite CI load": "Full dashboard suite green (122 files / 1419 tests, exit 0); pendingLive inherits the budget through its existing settleLive/closeLiveServer import with no file edit.", "3. GOTCHAS #122 gains the corollary: a condition drain with no timer of its own is still bounded by the enclosing testTimeout — raise both, or neither is load-tolerant": "Corollary added to docs/GOTCHAS.md entry #106 (the settleLive condition-drain gotcha; the issue's '#122' is a stale cross-number — repo #122 is the mesh-ports gotcha). It states a no-timer drain is load-tolerant only when the enclosing testTimeout is too, so raise both testTimeout and hookTimeout, or neither is." }, "summary": "The 30 s live-seam test budget now rides in from the shared liveServer.ts import, closing the vitest 5 s-default class so no seam (incl. pendingLive) reds on the outer clock under load.", "reason": "", "blockers": [], "no_code_change": "" } ``` </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#1276
No description provided.