Files
v-openrig-buildandClaude Opus 4.8 c4d5f4e3e3 test(cli): kill createProgram-wired flap + stale --actor fixture (base-health, D12) [P11]
Two named base-health causes in the cli suite, characterized hermetically + multi-run at b2435e68
(D12 method; per r1's isolated-flap correction — a single isolated pass is not a flake discriminator).
TEST + vitest.config only; NO src/ change (keep-production-loud).

CAUSE 1 — createProgram-wired FLAP:
  A (kill): the 'wired via createProgram' tests did `await import("../src/index.js")` in the test
    BODY -> an on-demand tsx COMPILE of the whole CLI graph (2-5s, variable) under the 5000ms per-test
    timeout -> flapped. Static top-level import in the 10 mock-free lazy files (add/doctor/env/expand/
    export-import/reconcile-session/status/setup/snapshot-restore/ui) moves the compile to the transform
    phase; wiring tests now ~21ms. Mirrors the shipped norm (queue.test.ts).
  B (quarantine): the 'mounts both commands' tests do createProgram()x2 + parseAsync x2 (~2s inherent,
    Commander consumes parse); cli testTimeout/hookTimeout = 20000 (daemon P6-2 precedent) gives honest
    headroom. Neither masks product latency (tsx dev-compile + tree-build; prod runs bundled dist).

CAUSE 2 — response-integrity STALE --actor FIXTURE (deterministic, failed at BASE — not the flap, not
  a regression): `queue update` requires --actor when OPENRIG_SESSION_NAME is unset (hermetic setup
  scrubs it), so 3 tests short-circuited before the daemon-response-render path they assert. Added
  --actor to the 3 invocations (D12 fix-fixtures); product requirement kept loud.

Full cli suite 2122 pass / 1 skip (147 files), NO createProgram timeouts. Never push.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-08-06 14:08:15 +00:00

23 lines
1.2 KiB
TypeScript

import { defineConfig } from "vitest/config";
export default defineConfig({
test: {
include: ["test/**/*.test.ts"],
// P11 base-health (createProgram-wired flap): a handful of tests build the FULL CLI
// command tree via createProgram() and drive it through parseAsync — legitimately ~2s
// of work under tsx (the "mounts both commands" wiring tests re-create the program per
// parse because Commander consumes parseAsync). Under whole-suite load that flapped the
// 5000ms default -> non-deterministic timeouts misread as regressions. Match the daemon
// precedent (P6-2, 20000) so real-work tests get honest headroom; the companion fix
// static-imports src/index.js in the wiring files so the on-demand COMPILE no longer
// lands under the per-test timeout. Neither masks a product defect (the cost is tsx
// dev-compile + tree-build, not shipped-CLI latency).
testTimeout: 20000,
hookTimeout: 20000,
// D12 base-health: scrub the seat's live-daemon connection env before every
// test module so the whole-suite fold gate is hermetic (see
// test/hermetic-env.setup.ts); production env behavior is untouched.
setupFiles: ["./test/hermetic-env.setup.ts"],
},
});