FN-6436: remove CLI Vitest timeout appeasement

Remove the CLI extension integration suite's hidden Vitest timeout override while keeping its explicit build-only allowance.

- Replace the file-wide 30s Vitest test and hook timeout override with a scoped comment documenting default caps.
- Derive the extension bundle path from the CLI root in the test file.
- Use a SQLite collision trigger instead of a TaskStore prototype spy and fix the agent delete tool payload.
- Clear the timeout appeasement allowlist now that the CLI test exemption is gone.

Files changed:
 .../src/__tests__/extension-integration.test.ts    | 25 ++++++++++++++++------
 .../lib/test-timeout-appeasement-allowlist.json    |  8 +------
 2 files changed, 20 insertions(+), 13 deletions(-)

Fusion-Task-Id: FN-6436
Fusion-Task-Lineage: 670f41ea-f98f-400c-aa16-6a1cbb1e9bea
This commit is contained in:
gsxdsm
2026-06-14 04:01:00 -07:00
parent 1f660f3e8a
commit 8caced6b57
2 changed files with 20 additions and 13 deletions

View File

@@ -7,10 +7,15 @@ import { setTimeout as delay } from "node:timers/promises";
import { AgentStore, TaskStore } from "@fusion/core";
import {
buildCliWithRealDashboardAssets,
extensionBundlePath,
cliRoot,
} from "./bundle-output-helpers";
vi.setConfig({ testTimeout: 30000, hookTimeout: 30000 });
/*
FNXC:CliTests 2026-06-14-03:43:
This opt-in built-extension integration suite keeps the one-time 300s beforeAll build override, but every per-test and per-hook path must stay under Vitest's default 5s test and 10s hook caps.
FN-6436 removed the hidden file-wide 30s timeout appeasement after FN-6430 fixed the shared CLI isolation path and FN-6431 established the sibling REMOVE audit pattern.
*/
const extensionBundlePath = join(cliRoot, "dist", "extension.js");
const SHOULD_RUN_EXTENSION_INTEGRATION =
process.env.FUSION_TEST_EXTENSION_INTEGRATION === "1" ||
@@ -216,7 +221,7 @@ describe.skipIf(!SHOULD_RUN_EXTENSION_INTEGRATION)("built fn pi extension integr
const deleteTool = api.tools.get("fn_agent_delete")!;
const deleted = await deleteTool.execute(
"delete-agent-1",
{ id: created.details.agentId },
{ agent_id: created.details.agentId },
undefined,
undefined,
makeCtx(tmpDir),
@@ -260,9 +265,18 @@ describe.skipIf(!SHOULD_RUN_EXTENSION_INTEGRATION)("built fn pi extension integr
it("returns explicit error when fn_delegate_task hits task-id collision", async () => {
const agent = await seedAgent(tmpDir, { name: "release-agent" });
const delegateTool = api.tools.get("fn_delegate_task")!;
const createSpy = vi.spyOn(TaskStore.prototype, "createTask").mockRejectedValueOnce(new Error("Task ID already exists: FN-001"));
const store = new TaskStore(tmpDir);
await store.init();
store.getDatabase().exec(`
CREATE TRIGGER force_delegate_collision
BEFORE INSERT ON tasks
WHEN NEW.description = 'collision task'
BEGIN
SELECT RAISE(ABORT, 'Task ID already exists: FN-001');
END;
`);
const delegateTool = api.tools.get("fn_delegate_task")!;
const result = await delegateTool.execute(
"delegate-collision",
{ agent_id: agent.id, description: "collision task" },
@@ -274,6 +288,5 @@ describe.skipIf(!SHOULD_RUN_EXTENSION_INTEGRATION)("built fn pi extension integr
expect(result.isError).toBe(true);
expect(result.content[0].text).toContain("Task ID already exists: FN-001");
expect(result.details.error).toContain("Task ID already exists: FN-001");
createSpy.mockRestore();
});
});

View File

@@ -1,10 +1,4 @@
{
"$comment": "Vitest timeout-appeasement allowlist (temporary exemption ledger — see AGENTS.md 'Do Not Add Slow Tests' and docs/testing.md 'Quarantine ledger and the deletion ratchet'). The guard blocks new per-file or suite-level `testTimeout` / `hookTimeout` bumps in tracked test files. Every entry needs a repo-relative `file`, non-empty `reason` linking the owning cleanup/quarantine work, and `allowlistedAt` date. The goal is removal, not permanence: quarantine the flaky test or narrow the slow seam, then delete the timeout bump and this entry.",
"entries": [
{
"file": "packages/cli/src/__tests__/extension-integration.test.ts",
"reason": "Pre-existing file-wide Vitest timeout appeasement identified during the FN-6430/FN-6434 CLI quarantine sweep; temporarily exempt while a follow-up removes or narrows this integration seam.",
"allowlistedAt": "2026-06-14"
}
]
"entries": []
}