From cfd640ed3499769b3ee41a7118119ff884dbe8c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobi=20L=C3=BCtke?= Date: Sat, 11 Apr 2026 01:21:22 +0000 Subject: [PATCH] fix(test): resolve LLM test timeouts by disabling file parallelism MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Parallel test files each cold-load their own LLM model, competing for CPU and causing timeouts even at 120s. Sequential execution eliminates contention — tests that timed out at 30s now complete in 1-15s. Made-with: Cursor --- test/mcp.test.ts | 4 ++-- test/sdk.test.ts | 4 ++-- test/store.test.ts | 4 ++-- vitest.config.ts | 1 + 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/test/mcp.test.ts b/test/mcp.test.ts index 24f13cd..3ea87bd 100644 --- a/test/mcp.test.ts +++ b/test/mcp.test.ts @@ -358,7 +358,7 @@ describe("MCP Server", () => { expect(['lex', 'vec', 'hyde']).toContain(q.type); expect(q.query.length).toBeGreaterThan(0); } - }, 30000); // 30s timeout for model loading + }, 90000); test("performs RRF fusion on multiple result lists", () => { const list1: RankedResult[] = [ @@ -431,7 +431,7 @@ describe("MCP Server", () => { ); expect(reranked.length).toBeGreaterThan(0); - }); + }, 90000); }); // =========================================================================== diff --git a/test/sdk.test.ts b/test/sdk.test.ts index 6672316..689da27 100644 --- a/test/sdk.test.ts +++ b/test/sdk.test.ts @@ -624,7 +624,7 @@ describe("search (unified API)", () => { expect(results[0]).toHaveProperty("title"); expect(results[0]).toHaveProperty("bestChunk"); expect(results[0]).toHaveProperty("docid"); - }); + }, 90000); test("search() with intent and rerank:false returns results", async () => { const results = await store.search({ @@ -633,7 +633,7 @@ describe("search (unified API)", () => { rerank: false, }); expect(results.length).toBeGreaterThan(0); - }); + }, 60000); test("search() with collection filter", async () => { const results = await store.search({ diff --git a/test/store.test.ts b/test/store.test.ts index 93bfb7d..848ec96 100644 --- a/test/store.test.ts +++ b/test/store.test.ts @@ -2494,7 +2494,7 @@ describe.skipIf(!!process.env.CI)("LlamaCpp Integration", () => { } await cleanupTestDb(store); - }, 30000); + }, 90000); test("expandQuery caches results as JSON with types", async () => { const store = await createTestStore(); @@ -2509,7 +2509,7 @@ describe.skipIf(!!process.env.CI)("LlamaCpp Integration", () => { expect(queries2[0]?.type).toBeDefined(); await cleanupTestDb(store); - }, 30000); + }, 60000); test("rerank scores documents", async () => { const store = await createTestStore(); diff --git a/vitest.config.ts b/vitest.config.ts index fb6d61e..463e723 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -3,6 +3,7 @@ import { defineConfig } from "vitest/config"; export default defineConfig({ test: { testTimeout: 30000, + fileParallelism: false, include: ["test/**/*.test.ts"], }, });