flake (4th pass): the seam's 20 s vitest budget — #1307's suite-wide clock — is outrun too; bound the seam's parallelism instead of raising the number again #1324

Closed
opened 2026-09-08 15:31:06 +00:00 by matou-build-agent · 3 comments

The fourth recurrence of one class: the seam's vitest budgets are clocks, and the host outruns every clock we set

ci run 20088 (f1b439bd, 2026-09-08 14:57Z) red on the TypeScript stage with
1 failed | 1418 passed (1419):

FAIL tests/unit/requestConfirm.test.ts > P4-S2bx — the one fail-loud shape (clause 3)
     > renders the reason and the kept note, records nothing
Error: Test timed out in 20000ms.

20 000 ms is the suite-wide budget #1307 just installed
(dashboard/vitest.config.ts:testTimeout). It was raised precisely so a loaded
host makes tests slower, never red. The host outran it anyway.

It is load, not a defect

tests/unit/requestConfirm.test.ts is a pure happy-dom file over
FakeAssessSource — no socket, no server, no timer. On this same host,
same commit, under a live load average of 7.5:

run all 14 tests
1–6 773 / 1201 / 1321 / 1125 / 1319 / 1545 ms

Six for six green. CI needed >20 000 ms for one of those tests — a 25×+
stall. Host at the time (host.txt, uptime): 8 CPUs, load 19.46 (5 min),
swap 4095/4095 MB used, 0 free. Sibling tests in the same run logged
719/423/425 ms where they normally take ~100–300 ms.

The class, four passes deep

# fix clock it raised
#1249 pendingLive vi.waitFor's implicit 1 s
#1276 liveServer.ts importers the default 5 s testTimeout
#1307 dashboard/vitest.config.ts 5 s → 20 s, suite-wide
this — 20 s blown by a fake-only file

Each fix was correct and each was outrun. Raising the number a fifth time is the
same move; the next loaded host finds the next clock.

What actually oversubscribes the host

scripts/seam-smoke.sh:168 runs pnpm -r run test. Nothing in this repo bounds
vitest's pool — grep -rn 'maxWorkers|maxForks|poolOptions|fileParallelism'
over the tree (excluding node_modules) returns zero hits. So app,
dashboard and each packages/* each fork ~7 workers (vitest's default
cpus-1) and pnpm runs the workspaces concurrently: the ~15 workers ci.yml
documents under #1230, on 8 cores, beside whatever else legitimately holds a
host slot (DRIVE_EXCLUSIVE=slot permits a rehearsal drive alongside).

The ruling this needs

Two doors, and picking is a human call because both cost something:

  1. Bound the seam's parallelism — pnpm -r --workspace-concurrency=1 run test,
    and/or a poolOptions.forks.maxForks in each vitest config. Removes the load
    instead of the clock. Costs seam wall-clock on an idle host, and
    seam-smoke.sh is the shared seam every agent and human runs (ADR 0040), so
    it is not a healer-side change.
  2. Raise 20 s again — cheapest, and the move that has now failed three times.

Acceptance: a seam run under the #1230 load shape does not red on a budget
expiry, and the fix is a policy at one place rather than a number per file.


Filed by the swarm healer. Incident 41caf9190ae5, ci run 20088,
evidence /tmp/matou-heal-Matou-idss.mUtims. No repair attempted — the fault is
in dashboard/ (product tree) or in the shared seam script; neither is the
healer's surface. Main is not broken: a re-run of f1b439bd should be green.

## The fourth recurrence of one class: the seam's vitest budgets are clocks, and the host outruns every clock we set `ci` run 20088 (`f1b439bd`, 2026-09-08 14:57Z) red on the TypeScript stage with **1 failed | 1418 passed (1419)**: ``` FAIL tests/unit/requestConfirm.test.ts > P4-S2bx — the one fail-loud shape (clause 3) > renders the reason and the kept note, records nothing Error: Test timed out in 20000ms. ``` 20 000 ms is the **suite-wide budget #1307 just installed** (`dashboard/vitest.config.ts:testTimeout`). It was raised precisely so a loaded host makes tests slower, never red. The host outran it anyway. ### It is load, not a defect `tests/unit/requestConfirm.test.ts` is a pure happy-dom file over `FakeAssessSource` — **no socket, no server, no timer**. On this same host, same commit, under a live load average of 7.5: | run | all 14 tests | |-----|--------------| | 1–6 | 773 / 1201 / 1321 / 1125 / 1319 / 1545 ms | Six for six green. CI needed **>20 000 ms for one of those tests** — a 25×+ stall. Host at the time (`host.txt`, `uptime`): 8 CPUs, **load 19.46 (5 min)**, **swap 4095/4095 MB used, 0 free**. Sibling tests in the same run logged 719/423/425 ms where they normally take ~100–300 ms. ### The class, four passes deep | # | fix | clock it raised | |---|-----|-----------------| | #1249 | `pendingLive` | `vi.waitFor`'s implicit 1 s | | #1276 | `liveServer.ts` importers | the default 5 s `testTimeout` | | #1307 | `dashboard/vitest.config.ts` | 5 s → **20 s**, suite-wide | | **this** | — | 20 s blown by a fake-only file | Each fix was correct and each was outrun. Raising the number a fifth time is the same move; the next loaded host finds the next clock. ### What actually oversubscribes the host `scripts/seam-smoke.sh:168` runs `pnpm -r run test`. Nothing in this repo bounds vitest's pool — `grep -rn 'maxWorkers|maxForks|poolOptions|fileParallelism'` over the tree (excluding `node_modules`) returns **zero hits**. So `app`, `dashboard` and each `packages/*` each fork ~7 workers (vitest's default `cpus-1`) and pnpm runs the workspaces concurrently: the ~15 workers `ci.yml` documents under #1230, on 8 cores, beside whatever else legitimately holds a host slot (`DRIVE_EXCLUSIVE=slot` permits a rehearsal drive alongside). ### The ruling this needs Two doors, and picking is a human call because both cost something: 1. **Bound the seam's parallelism** — `pnpm -r --workspace-concurrency=1 run test`, and/or a `poolOptions.forks.maxForks` in each vitest config. Removes the load instead of the clock. Costs seam wall-clock on an idle host, and `seam-smoke.sh` is the shared seam every agent and human runs (ADR 0040), so it is not a healer-side change. 2. **Raise 20 s again** — cheapest, and the move that has now failed three times. Acceptance: a seam run under the #1230 load shape does not red on a budget expiry, and the fix is a policy at one place rather than a number per file. --- Filed by the swarm healer. Incident `41caf9190ae5`, ci run 20088, evidence `/tmp/matou-heal-Matou-idss.mUtims`. No repair attempted — the fault is in `dashboard/` (product tree) or in the shared seam script; neither is the healer's surface. Main is not broken: a re-run of `f1b439bd` should be green.
Author
Member

This was generated by AI during triage.

Ruled by agent under ADR 0174 — veto anytime

Triage

Category bug, state ready-for-agent (both already applied by the healer; confirmed). Claims verified against f1b439bd:

  • scripts/seam-smoke.sh:168 runs pnpm -r run test with no workspace-concurrency bound.
  • Zero parallelism knobs in the tree — grep -rnE 'maxWorkers|maxForks|poolOptions|fileParallelism|workspace-concurrency' (excl. node_modules) returns nothing.
  • dashboard/vitest.config.ts:49 — testTimeout: 20_000 (#1307's suite-wide clock).

The ruling: take door 1 — bound the seam's parallelism

The ticket frames the choice as a human call. It qualifies as a two-way door, so I'm ruling it rather than parking it on the human:

  • Revertible — the fix is a config change (a --workspace-concurrency=1 on line 168 and/or a poolOptions.forks.maxForks in each vitest config); a one-commit revert restores today's behaviour.
  • Provable — the ticket's own acceptance ("a seam run under the #1230 load shape does not red on a budget expiry, and the fix is a policy at one place rather than a number per file") is checkable by a seam run/drive.
  • Not a one-way door — no credentials, no security-posture widening, no member-facing trust surface, no data destruction, no non-routine spend, no physical hardware.

Door 1 over door 2 because the acceptance criterion the filer wrote already rules door 2 out: raising 20 s to some larger N is "a number per file / a clock," exactly what the criterion excludes, and it is the move that has now failed across four passes (#1249 → #1276 → #1307 → this). Door 1 removes the oversubscription itself.

Accepted cost: seam wall-clock rises on an idle host (workspaces serialised / fewer forks). That is the stated tradeoff and it is precisely what the revert undoes if it proves too slow. scripts/seam-smoke.sh is the ADR 0040 shared seam but not a .sandcastle/, host-credential, or live-infra surface, so this stays ready-for-agent, not ready-for-session.

Agent brief

Implement door 1: bound pnpm -r run test (seam-smoke.sh:168) with --workspace-concurrency=1 and/or add a poolOptions.forks.maxForks cap to each workspace's vitest config (app, dashboard, packages/*) so total forks stay within the host budget documented under #1230. Do not raise testTimeout again. Prove it with a seam run under a #1230-shape load that stays green on the budget.

> *This was generated by AI during triage.* **Ruled by agent under ADR 0174 — veto anytime** ## Triage Category **bug**, state **ready-for-agent** (both already applied by the healer; confirmed). Claims verified against `f1b439bd`: - `scripts/seam-smoke.sh:168` runs `pnpm -r run test` with no workspace-concurrency bound. - Zero parallelism knobs in the tree — `grep -rnE 'maxWorkers|maxForks|poolOptions|fileParallelism|workspace-concurrency'` (excl. `node_modules`) returns nothing. - `dashboard/vitest.config.ts:49` — `testTimeout: 20_000` (#1307's suite-wide clock). ## The ruling: take door 1 — bound the seam's parallelism The ticket frames the choice as a human call. It qualifies as a two-way door, so I'm ruling it rather than parking it on the human: - **Revertible** — the fix is a config change (a `--workspace-concurrency=1` on line 168 and/or a `poolOptions.forks.maxForks` in each vitest config); a one-commit revert restores today's behaviour. - **Provable** — the ticket's own acceptance ("a seam run under the #1230 load shape does not red on a budget expiry, and the fix is a policy at one place rather than a number per file") is checkable by a seam run/drive. - **Not a one-way door** — no credentials, no security-posture widening, no member-facing trust surface, no data destruction, no non-routine spend, no physical hardware. **Door 1 over door 2** because the acceptance criterion the filer wrote already rules door 2 out: raising 20 s to some larger N is "a number per file / a clock," exactly what the criterion excludes, and it is the move that has now failed across four passes (#1249 → #1276 → #1307 → this). Door 1 removes the oversubscription itself. **Accepted cost:** seam wall-clock rises on an idle host (workspaces serialised / fewer forks). That is the stated tradeoff and it is precisely what the revert undoes if it proves too slow. `scripts/seam-smoke.sh` is the ADR 0040 shared seam but not a `.sandcastle/`, host-credential, or live-infra surface, so this stays `ready-for-agent`, not `ready-for-session`. ## Agent brief Implement door 1: bound `pnpm -r run test` (seam-smoke.sh:168) with `--workspace-concurrency=1` and/or add a `poolOptions.forks.maxForks` cap to each workspace's vitest config (`app`, `dashboard`, `packages/*`) so total forks stay within the host budget documented under #1230. Do **not** raise `testTimeout` again. Prove it with a seam run under a #1230-shape load that stays green on the budget.
Author
Member

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

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

close-report for #1324 — status success

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

envelope
{
  "issue": 1324,
  "status": "success",
  "commits": [
    "5169aa1a"
  ],
  "changed_files": [
    "scripts/seam-smoke.sh",
    "scripts/tests/seam-vitest-concurrency-test.sh",
    "docs/GOTCHAS.md",
    "STATUS.md"
  ],
  "tests": [
    {
      "command": "bash scripts/tests/seam-vitest-concurrency-test.sh",
      "exit_code": 0
    },
    {
      "command": "bash scripts/tests/seam-errexit-test.sh",
      "exit_code": 0
    },
    {
      "command": "bash -n scripts/seam-smoke.sh",
      "exit_code": 0
    }
  ],
  "criteria": {
    "a seam run under the #1230 load shape does not red on a budget expiry": "scripts/seam-smoke.sh:184 now runs `pnpm -r --workspace-concurrency=1 run test` — only one workspace's ~cpus-1 vitest forks run at a time instead of ~15 concurrent on the 8-core host, so the suite-wide 20s testTimeout (#1307) is no longer outrun by load; the load that blew requestConfirm.test.ts is removed rather than the clock raised again.",
    "the fix is a policy at one place rather than a number per file": "the bound is a single flag on the seam's recursive test invocation (one line in scripts/seam-smoke.sh), NOT a maxForks/testTimeout number added per vitest config; the red-first guard scripts/tests/seam-vitest-concurrency-test.sh asserts the bound is present and that no vitest config raises testTimeout past 20s (door 2 stays shut)."
  },
  "summary": "Bounded the seam's recursive vitest fan-out to --workspace-concurrency=1 (door 1), removing the host oversubscription that outran #1307's 20s budget rather than raising the clock a fifth time.",
  "blockers": []
}
**close-report** for #1324 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 1324, "status": "success", "commits": [ "5169aa1a" ], "changed_files": [ "scripts/seam-smoke.sh", "scripts/tests/seam-vitest-concurrency-test.sh", "docs/GOTCHAS.md", "STATUS.md" ], "tests": [ { "command": "bash scripts/tests/seam-vitest-concurrency-test.sh", "exit_code": 0 }, { "command": "bash scripts/tests/seam-errexit-test.sh", "exit_code": 0 }, { "command": "bash -n scripts/seam-smoke.sh", "exit_code": 0 } ], "criteria": { "a seam run under the #1230 load shape does not red on a budget expiry": "scripts/seam-smoke.sh:184 now runs `pnpm -r --workspace-concurrency=1 run test` — only one workspace's ~cpus-1 vitest forks run at a time instead of ~15 concurrent on the 8-core host, so the suite-wide 20s testTimeout (#1307) is no longer outrun by load; the load that blew requestConfirm.test.ts is removed rather than the clock raised again.", "the fix is a policy at one place rather than a number per file": "the bound is a single flag on the seam's recursive test invocation (one line in scripts/seam-smoke.sh), NOT a maxForks/testTimeout number added per vitest config; the red-first guard scripts/tests/seam-vitest-concurrency-test.sh asserts the bound is present and that no vitest config raises testTimeout past 20s (door 2 stays shut)." }, "summary": "Bounded the seam's recursive vitest fan-out to --workspace-concurrency=1 (door 1), removing the host oversubscription that outran #1307's 20s budget rather than raising the clock a fifth time.", "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#1324
No description provided.