Skip to content

Commit cfd640e

Browse files
committed
fix(test): resolve LLM test timeouts by disabling file parallelism
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
1 parent 3023ab3 commit cfd640e

4 files changed

Lines changed: 7 additions & 6 deletions

File tree

test/mcp.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ describe("MCP Server", () => {
358358
expect(['lex', 'vec', 'hyde']).toContain(q.type);
359359
expect(q.query.length).toBeGreaterThan(0);
360360
}
361-
}, 30000); // 30s timeout for model loading
361+
}, 90000);
362362

363363
test("performs RRF fusion on multiple result lists", () => {
364364
const list1: RankedResult[] = [
@@ -431,7 +431,7 @@ describe("MCP Server", () => {
431431
);
432432

433433
expect(reranked.length).toBeGreaterThan(0);
434-
});
434+
}, 90000);
435435
});
436436

437437
// ===========================================================================

test/sdk.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -624,7 +624,7 @@ describe("search (unified API)", () => {
624624
expect(results[0]).toHaveProperty("title");
625625
expect(results[0]).toHaveProperty("bestChunk");
626626
expect(results[0]).toHaveProperty("docid");
627-
});
627+
}, 90000);
628628

629629
test("search() with intent and rerank:false returns results", async () => {
630630
const results = await store.search({
@@ -633,7 +633,7 @@ describe("search (unified API)", () => {
633633
rerank: false,
634634
});
635635
expect(results.length).toBeGreaterThan(0);
636-
});
636+
}, 60000);
637637

638638
test("search() with collection filter", async () => {
639639
const results = await store.search({

test/store.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2494,7 +2494,7 @@ describe.skipIf(!!process.env.CI)("LlamaCpp Integration", () => {
24942494
}
24952495

24962496
await cleanupTestDb(store);
2497-
}, 30000);
2497+
}, 90000);
24982498

24992499
test("expandQuery caches results as JSON with types", async () => {
25002500
const store = await createTestStore();
@@ -2509,7 +2509,7 @@ describe.skipIf(!!process.env.CI)("LlamaCpp Integration", () => {
25092509
expect(queries2[0]?.type).toBeDefined();
25102510

25112511
await cleanupTestDb(store);
2512-
}, 30000);
2512+
}, 60000);
25132513

25142514
test("rerank scores documents", async () => {
25152515
const store = await createTestStore();

vitest.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { defineConfig } from "vitest/config";
33
export default defineConfig({
44
test: {
55
testTimeout: 30000,
6+
fileParallelism: false,
67
include: ["test/**/*.test.ts"],
78
},
89
});

0 commit comments

Comments
 (0)