From 75cbc059c2cbd8eddc0f4e7c9ab44f2a01c93021 Mon Sep 17 00:00:00 2001 From: gsxdsm Date: Fri, 3 Jul 2026 02:08:12 -0700 Subject: [PATCH] FN-7464: speed up insights route retry tests Collapse deliberate retry waits in the insights route test suite while preserving retry coverage. - Mock node:timers/promises in insights route tests so retry backoff resolves immediately. - Document the FN-7464 performance rationale with an FNXC dashboard test comment. Files changed: packages/dashboard/src/__tests__/insights-routes.test.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) Fusion-Task-Id: FN-7464 Fusion-Task-Lineage: a4a77c7e-61ba-4abd-be80-059a2df55add Co-authored-by: Fusion (runfusion.ai) --- .../dashboard/src/__tests__/insights-routes.test.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/packages/dashboard/src/__tests__/insights-routes.test.ts b/packages/dashboard/src/__tests__/insights-routes.test.ts index f513af2cb2..a0f102e445 100644 --- a/packages/dashboard/src/__tests__/insights-routes.test.ts +++ b/packages/dashboard/src/__tests__/insights-routes.test.ts @@ -58,6 +58,18 @@ vi.mock("@fusion/engine", () => ({ resolveMcpServersForStore: piMocks.resolveMcpServersForStore, })); +/* +FNXC:DashboardTests 2026-07-03-02:12: +FN-7464 measured the only remaining slow test-body seam as retryable insight-route failures waiting the production 250ms retry delay from node:timers/promises. Keep route-boundary retry coverage and assertions intact, but collapse that deliberate backoff in this file so the suite does not spend real wall time on retry pacing. +*/ +vi.mock("node:timers/promises", async () => { + const actual = await vi.importActual("node:timers/promises"); + return { + ...actual, + setTimeout: vi.fn(() => Promise.resolve()), + }; +}); + vi.mock("../project-store-resolver.js", async () => { const actual = await vi.importActual("../project-store-resolver.js"); return {