diff --git a/docs/testing.md b/docs/testing.md index be43e790b8..de2da2e645 100644 --- a/docs/testing.md +++ b/docs/testing.md @@ -201,7 +201,13 @@ Legitimate legacy exceptions must be recorded in `scripts/lib/test-timeout-appea -**2026-06-19 quarantine audit (FN-6740):** the 2026-06-19 ledger batch expires on **2026-07-03**. FN-6740 found no ledger/config half-state and chose no inline rescue/delete. The five CLI files (`extension-goal-tools`, `extension-mission-goal-tools`, `extension-task-tools`, `extension`, `research-extension-tools`) are explicitly deferred to FN-6734's outcome and must not get a duplicate rescue task. The six core files (`activity-analytics`, `db`, `store-concurrent-writes`, `store-create-summarize-deferred-hook`, `vitest-teardown-worker-root-cleanup`, `settings-export`) are tracked by FN-6741 as a shared worker-root/temp-redirect cleanup-race follow-up, with the repeat after FN-6600/FN-6486 treated as a product-race signal. The dashboard files are split by likely root cause: FN-6742 owns `session-cross-tab` cleanup `ENOTEMPTY`, FN-6743 owns the third-repeat QuickEntryBox focus-restoration race after FN-6514/FN-6642, and FN-6744 owns WorkflowNodeEditor duplicate-merge-seam concurrency. Until those follow-ups rescue with root-cause evidence or delete under the ratchet, leave all corresponding ledger entries and package excludes in lockstep. +**2026-06-19 quarantine audit (FN-6740):** the 2026-06-19 ledger batch expires on **2026-07-03**. FN-6740 found no ledger/config half-state and chose no inline rescue/delete. The five CLI files (`extension-goal-tools`, `extension-mission-goal-tools`, `extension-task-tools`, `extension`, `research-extension-tools`) are explicitly deferred to FN-6734's outcome and must not get a duplicate rescue task. Five core files (`activity-analytics`, `db`, `store-create-summarize-deferred-hook`, `vitest-teardown-worker-root-cleanup`, `settings-export`) were rescued by FN-6741 after the loaded `@fusion/core` lane passed with only `store-concurrent-writes` re-quarantined; `settings-export` now closes its `TaskStore` before fixture cleanup. The dashboard files are split by likely root cause: FN-6742 owns `session-cross-tab` cleanup `ENOTEMPTY`, FN-6743 owns the third-repeat QuickEntryBox focus-restoration race after FN-6514/FN-6642, and FN-6744 owns WorkflowNodeEditor duplicate-merge-seam concurrency. Until those dashboard and remaining core follow-ups rescue with root-cause evidence or delete under the ratchet, leave all corresponding ledger entries and package excludes in lockstep. + + + +**2026-06-19 core suite-load rescue (FN-6741):** `activity-analytics.test.ts`, `db.test.ts`, `store-create-summarize-deferred-hook.test.ts`, `vitest-teardown-worker-root-cleanup.test.ts`, and `settings-export.test.ts` were rescued before their 2026-07-03 deletion deadline. The key evidence was a loaded `pnpm --filter @fusion/core test` pass across the package after re-quarantining `store-concurrent-writes.test.ts`, with no `ENOTEMPTY`, `EBUSY`, hook timeout, or missed deferred hook in the rescued files. Four files needed no weakening because their regression value still held under load; `settings-export.test.ts` kept its import/export coverage but now closes the real `TaskStore` before removing the fixture root. `store-concurrent-writes.test.ts` remains in the deletion ratchet after merge verification re-observed the broad-lane SQLite lock flake. Required closure evidence for this class is ledger/config convergence, the rescued package lane, the timeout-appeasement guard, `pnpm test:gate`, `pnpm test`, `pnpm typecheck`, and `pnpm build`. **2026-06-16 rescue (FN-6514):** `packages/dashboard/app/components/__tests__/QuickEntryBox.test.tsx` was rescued before its 2026-06-30 deletion deadline. The file still caught real quick-entry behavior regressions, but it leaked jsdom descriptors for `window.innerWidth`, `window.matchMedia`, `document.visibilityState`, `URL.createObjectURL`, and `URL.revokeObjectURL`; a mobile viewport helper could leave later tests in the same dashboard backfill shard observing `innerWidth=375` and mismatched responsive assertions. The rescue removed the ledger/config quarantine entries in lockstep, captured each original `PropertyDescriptor` at module load, restored those descriptors (or deleted own properties that were originally absent) in `afterEach`, and added a guard test that mutates all rescued globals before asserting they return to their original descriptors. Reusable pattern: any test file that changes jsdom globals with `Object.defineProperty` or spies on replaceable globals must snapshot the original descriptor at the top of the file, restore it in every `afterEach`, and prove the invariant with a guard test; do not use timeout bumps, retries, worker changes, or blanket `vi.restoreAllMocks()` when module mocks depend on stable implementations. diff --git a/packages/core/src/__tests__/settings-export.test.ts b/packages/core/src/__tests__/settings-export.test.ts index 365227ccac..6ff5e5da97 100644 --- a/packages/core/src/__tests__/settings-export.test.ts +++ b/packages/core/src/__tests__/settings-export.test.ts @@ -63,6 +63,11 @@ describe("settings-export", () => { }); afterEach(() => { + /* + FNXC:CoreTests 2026-06-19-14:30: + FN-6741 rescues settings-export from the core suite-load quarantine by closing the in-memory TaskStore before removing its fixture root. The test still covers settings import/export behavior, but teardown must release store resources before temp cleanup instead of relying on process exit. + */ + store.close(); cleanupTestEnv(env.tempDir); }); diff --git a/packages/core/vitest.config.ts b/packages/core/vitest.config.ts index 37a255067f..264408a252 100644 --- a/packages/core/vitest.config.ts +++ b/packages/core/vitest.config.ts @@ -33,13 +33,14 @@ const quarantinedCoreTests = [ FNXC:CoreTests 2026-06-19-10:24: FN-6705 verification then observed settings-export time out in beforeEach only under the broad changed-package core lane while the targeted file rerun passed in 5.1s. Quarantine the suite-load hook flake instead of increasing hookTimeout. + + FNXC:CoreTests 2026-06-19-14:31: + FN-6741 reloaded the six 2026-06-19 core quarantine files under the broad @fusion/core lane and rescued them in lockstep with scripts/lib/test-quarantine.json. Keep this array empty; future core suite-load flakes must prove a remaining shared worker-root/temp-redirect or fixture close-order gap before re-quarantining. + + FNXC:CoreTests 2026-06-19-15:05: + Merge verification for FN-6741 observed store-concurrent-writes fail again under the broad @fusion/core lane with SQLite BEGIN IMMEDIATE lock exhaustion. Re-quarantine that single suite-load lock flake in lockstep with the ledger; keep the other rescued core files loaded. */ - "src/__tests__/activity-analytics.test.ts", - "src/__tests__/db.test.ts", "src/__tests__/store-concurrent-writes.test.ts", - "src/__tests__/store-create-summarize-deferred-hook.test.ts", - "src/__tests__/vitest-teardown-worker-root-cleanup.test.ts", - "src/__tests__/settings-export.test.ts", ]; export default defineConfig({ diff --git a/scripts/lib/test-quarantine.json b/scripts/lib/test-quarantine.json index 252cc154af..4187ed8d48 100644 --- a/scripts/lib/test-quarantine.json +++ b/scripts/lib/test-quarantine.json @@ -16,34 +16,9 @@ "reason": "FN-6726 local workspace `pnpm test` observed the duplicate-merge-seam template conflict assertion fail only in the broad dashboard components-b shard, while a targeted rerun of that exact test passed; quarantine the workflow editor concurrency flake instead of appeasing unrelated template insertion behavior while the Command Center token containment fix remains scoped.", "quarantinedAt": "2026-06-19" }, - { - "file": "packages/core/src/__tests__/activity-analytics.test.ts", - "reason": "FN-6705 local workspace `pnpm test` observed this core file fail only in the broad changed-package core lane (hook/test timeout, ENOTEMPTY cleanup, or missed deferred hook under suite load); immediate targeted rerun of all five files passed, so quarantine the suite-load flake instead of appeasing it with wider timeouts/retries.", - "quarantinedAt": "2026-06-19" - }, - { - "file": "packages/core/src/__tests__/db.test.ts", - "reason": "FN-6705 local workspace `pnpm test` observed this core file fail only in the broad changed-package core lane (hook/test timeout, ENOTEMPTY cleanup, or missed deferred hook under suite load); immediate targeted rerun of all five files passed, so quarantine the suite-load flake instead of appeasing it with wider timeouts/retries.", - "quarantinedAt": "2026-06-19" - }, { "file": "packages/core/src/__tests__/store-concurrent-writes.test.ts", - "reason": "FN-6705 local workspace `pnpm test` observed this core file fail only in the broad changed-package core lane (hook/test timeout, ENOTEMPTY cleanup, or missed deferred hook under suite load); immediate targeted rerun of all five files passed, so quarantine the suite-load flake instead of appeasing it with wider timeouts/retries.", - "quarantinedAt": "2026-06-19" - }, - { - "file": "packages/core/src/__tests__/store-create-summarize-deferred-hook.test.ts", - "reason": "FN-6705 local workspace `pnpm test` observed this core file fail only in the broad changed-package core lane (hook/test timeout, ENOTEMPTY cleanup, or missed deferred hook under suite load); immediate targeted rerun of all five files passed, so quarantine the suite-load flake instead of appeasing it with wider timeouts/retries.", - "quarantinedAt": "2026-06-19" - }, - { - "file": "packages/core/src/__tests__/vitest-teardown-worker-root-cleanup.test.ts", - "reason": "FN-6705 local workspace `pnpm test` observed this core file fail only in the broad changed-package core lane (hook/test timeout, ENOTEMPTY cleanup, or missed deferred hook under suite load); immediate targeted rerun of all five files passed, so quarantine the suite-load flake instead of appeasing it with wider timeouts/retries.", - "quarantinedAt": "2026-06-19" - }, - { - "file": "packages/core/src/__tests__/settings-export.test.ts", - "reason": "FN-6705 local workspace `pnpm test` observed this core file time out in beforeEach only in the broad changed-package core lane; immediate targeted rerun passed in 5.1s, so quarantine the suite-load hook flake instead of appeasing it with wider hook timeouts/retries.", + "reason": "FN-6741 merge verification observed store-concurrent-writes fail again only under the broad @fusion/core lane with SQLite BEGIN IMMEDIATE lock exhaustion after the other same-day core quarantine entries stayed loaded; re-quarantine this suite-load lock flake instead of widening SQLite lock-recovery timing, adding retries, or weakening concurrent-write assertions.", "quarantinedAt": "2026-06-19" }, {