Files
fusion/scripts/lib/test-quarantine.json
gsxdsm 2fc6d4d667 FN-6430: rescue CLI quarantine tests
Rescue the quarantined CLI suites by fixing shared test isolation instead of extending timeouts.

- Remove rescued CLI files from the quarantine ledger and Vitest exclude list while preserving an empty rescue ledger comment.
- Tighten Vitest HOME isolation to reject inherited worker homes and sweep legacy top-level fn-test-home roots with bounded cleanup.
- Reset affected CLI fixtures, close research stores, and narrow the slow mission store seam so rescued tests run on default timeouts.
- Document the CLI shared-fixture rescue pattern for future quarantine recoveries.

Files changed:
 docs/testing.md                                    |   2 +
 .../cli/src/__tests__/extension-task-tools.test.ts |   7 +-
 packages/cli/src/__tests__/extension.test.ts       | 117 +++++++++----------
 .../cli/src/commands/__tests__/mission.test.ts     |  16 ++-
 packages/cli/src/commands/__tests__/plugin.test.ts |   5 +
 packages/cli/vitest.config.ts                      |  52 ++-------
 packages/core/src/__test-utils__/vitest-setup.ts   |  25 ++++-
 .../core/src/__test-utils__/vitest-teardown.ts     |  28 ++++-
 .../vitest-teardown-worker-root-cleanup.test.ts    |  15 +++
 scripts/lib/test-quarantine.json                   | 124 +--------------------
 10 files changed, 157 insertions(+), 234 deletions(-)

Fusion-Task-Id: FN-6430

Fusion-Task-Lineage: 943b73b4-5f92-4703-8e93-0ae3207eb63c
2026-06-14 15:29:35 -07:00

66 lines
7.9 KiB
JSON

{
"$comment": "Flaky-test quarantine ledger (deletion ratchet — see AGENTS.md 'Flaky tests: quarantine on sight' and docs/testing.md 'Quarantine ledger and the deletion ratchet'). A test observed failing without a corresponding real bug is quarantined ON SIGHT: add an entry here AND a matching one-line `exclude` entry in that package's vitest config, in the same commit. Every entry needs a non-empty `reason` (link the failing run) and a `quarantinedAt` date — the entry expires 14 days later, at which point the test file is DELETED unless someone rescues it with evidence it catches real regressions plus a root-cause fix (never appeasement). There is deliberately no loader module and no automation around this file: it is a dated record, the vitest config exclude is the mechanism, and the sweep is policy executed by whoever touches the suite.",
"entries": [
{
"file": "packages/engine/src/__tests__/merger-ai-cleanup-active-session.test.ts",
"reason": "Flake: pruneExistingAiMergeWorktrees skips active-session paths — active-session temp AI merge dir was unexpectedly pruned during pnpm --filter @fusion/engine test in FN-6206 verification, while the same file passed standalone. Root cause suspected: realpathSync resolution mismatch or readdirSync mock interaction with activeSessionRegistry singleton under concurrent engine suite load. Discovered during FN-6206.",
"quarantinedAt": "2026-06-10"
},
{
"file": "packages/engine/src/__tests__/merger-ai-cleanup.test.ts",
"reason": "Flake observed during FN-6206 verification: `pruneExistingAiMergeWorktrees skips active-session paths` failed in full `pnpm --filter @fusion/engine test` runs while the file passed standalone, indicating suite-order/concurrency sensitivity. Follow-up FN-6207.",
"quarantinedAt": "2026-06-10"
},
{
"file": "packages/engine/src/__tests__/merger-ai.test.ts",
"reason": "Flake observed during FN-6238 verification: full `pnpm --filter @fusion/engine test` failed in two merger-ai tests with git ENOENT / unable to read current working directory after a temp checkout disappeared, while the file passed standalone (23/23). Follow-up FN-6248.",
"quarantinedAt": "2026-06-11"
},
{
"file": "packages/dashboard/app/components/__tests__/QuickEntryBox.test.tsx",
"reason": "Flake observed during FN-6239 verification: broad `pnpm test` in dashboard backfill shard 4/4 could not find `quick-entry-priority-button` immediately after a successful task creation, while the named test passed standalone. Indicates suite-order/concurrency sensitivity unrelated to QuickChatFAB coverage.",
"quarantinedAt": "2026-06-11"
},
{
"file": "packages/engine/src/__tests__/reliability-interactions/soft-delete-blocker-residue.test.ts",
"reason": "Flake observed during FN-6294 verification and reproduced during FN-6319 broad `pnpm --filter @fusion/engine test`: `clearStaleBlockedBy handles missed task:deleted event with soft-deleted-blocker reason` failed because the log entry was absent, while the same file passed standalone and the narrow three-file reproduction passed. Product-code cross-check: `clearStaleBlockedBy` still has the soft-deleted-blocker branch and soft-delete-deadlock-scan-exclusion.test.ts covers it via a deterministic store double, indicating suite-order/concurrency sensitivity in this reliability-interactions fixture rather than a confirmed product bug.",
"quarantinedAt": "2026-06-12"
},
{
"file": "packages/core/src/__tests__/store-handoff-to-review.test.ts",
"reason": "Flake observed during full workspace verification on 2026-06-13: `pnpm test:full` failed in `TaskStore handoffToReview > audits direct moveTask in-review transitions as invariant violations` because the test file's `beforeEach` exceeded the 15s core hook timeout under recursive full-suite load. The same file passed standalone immediately afterward (`pnpm --filter @fusion/core exec vitest run src/__tests__/store-handoff-to-review.test.ts --silent=passed-only --reporter=dot`, 8/8), so this is suite-load/concurrency sensitivity rather than a confirmed product bug. Quarantined instead of widening hook timeouts.",
"quarantinedAt": "2026-06-13"
},
{
"file": "packages/core/src/__tests__/db.test.ts",
"reason": "Slow/flaky core suite observed during 2026-06-13 verification: full core package runs timed out in `Database > change detection > bumpLastModified strictly increases the timestamp` beforeEach under the 15s hook timeout. A direct file run also exposed a real `Database.recoverIfCorrupt` failed-swap preservation bug, which was fixed separately; the file remains a 176s standalone slow offender and its hook timeout is suite-load sensitivity, so it is quarantined rather than appeased with broader hook timeouts.",
"quarantinedAt": "2026-06-13"
},
{
"file": "packages/core/src/__tests__/run-audit.integration.test.ts",
"reason": "Slow/flaky core suite observed during 2026-06-13 verification: `pnpm --filter @fusion/core test` timed out in `Run Audit Integration > multi-domain event correlation > round-trips sandbox domain events and filters by sandbox` beforeEach and then produced ENOTEMPTY cleanup fallout. The same file passed as a direct run (24/24) but took about 90s, indicating load-sensitive slow-test behavior rather than a confirmed product bug.",
"quarantinedAt": "2026-06-13"
},
{
"file": "packages/core/src/__tests__/run-audit.test.ts",
"reason": "Slow/flaky core suite observed during 2026-06-13 verification: `pnpm --filter @fusion/core test` timed out in `Run Audit > recordRunAuditEvent > records a basic audit event with required fields` beforeEach and then produced ENOTEMPTY cleanup fallout. The same file passed as a direct run (28/28) but took about 96s, indicating load-sensitive slow-test behavior rather than a confirmed product bug.",
"quarantinedAt": "2026-06-13"
},
{
"file": "packages/core/src/__tests__/todo-store.test.ts",
"reason": "Slow/flaky core suite observed during 2026-06-13 verification: `pnpm --filter @fusion/core test` timed out in `TodoStore > list CRUD > listLists returns lists ordered by createdAt and scoped by project` beforeEach. The same file passed as a direct run (18/18) but took about 48s, indicating load-sensitive slow-test behavior rather than a confirmed product bug.",
"quarantinedAt": "2026-06-13"
},
{
"file": "packages/dashboard/scripts/__tests__/run-vitest-with-heap.test.ts",
"reason": "FN-6416 quarantine: flake observed during FN-6411 `pnpm test` dashboard api:curated lane on 2026-06-13: `run-vitest-with-heap > times out and reaps the spawned process group` failed waiting for its stub process tree within 5000ms under full dashboard API load and left `fusion-test-workers-*` temp-worker roots for bounded cleanup. The same test passed standalone immediately afterward (`pnpm --filter @fusion/dashboard exec vitest run --project dashboard-api-quality scripts/__tests__/run-vitest-with-heap.test.ts -t \"times out and reaps the spawned process group\" --silent=passed-only --reporter=dot`, 1/1), indicating timing/concurrency sensitivity. Quarantined instead of widening wait timeouts.",
"quarantinedAt": "2026-06-13"
},
{
"file": "packages/dashboard/src/__tests__/routes-git.test.ts",
"reason": "Flake observed during `pnpm test` dashboard api:curated lane on 2026-06-13: `Git Management endpoints > GET /git/branches/:name/commits > respects limit parameter` returned 400 instead of 200 under concurrent dashboard API tests. The same filtered file passed standalone immediately afterward (`pnpm --filter @fusion/dashboard exec vitest run --project dashboard-api-quality src/__tests__/routes-git.test.ts -t \"respects limit parameter\" --silent=passed-only --reporter=dot`, 3/3), indicating suite-load or fixture-state sensitivity rather than a confirmed product bug. Quarantined instead of loosening assertions.",
"quarantinedAt": "2026-06-13"
}
]
}