Преглед изворни кода

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
Tobi Lütke пре 1 месец
родитељ
комит
cfd640ed34
4 измењених фајлова са 7 додато и 6 уклоњено
  1. 2 2
      test/mcp.test.ts
  2. 2 2
      test/sdk.test.ts
  3. 2 2
      test/store.test.ts
  4. 1 0
      vitest.config.ts

+ 2 - 2
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);
   });
 
   // ===========================================================================

+ 2 - 2
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({

+ 2 - 2
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();

+ 1 - 0
vitest.config.ts

@@ -3,6 +3,7 @@ import { defineConfig } from "vitest/config";
 export default defineConfig({
   test: {
     testTimeout: 30000,
+    fileParallelism: false,
     include: ["test/**/*.test.ts"],
   },
 });