Skip to content

Commit e63f0a4

Browse files
test: raise TS SDK filter-scope test timeouts and parallelize ingests
The "filterId in chat actually scopes retrieval to data_sources" integration test was timing out at 60s and failing CI on every run. The chat itself works (backend logs show the response generated in ~7.6s); the 60s budget was consumed by two sequential Docling ingests (~25s each in CI) plus the filter create before the chat even started, so the test crossed the deadline. Bump the three ingest-heavy filter-scope tests (chat, search, delete-by-filter) to a 180s per-test timeout and ingest the two docs concurrently via Promise.all to shorten the critical path. Raise the global vitest testTimeout 60s -> 120s so lighter tests have headroom too. The Python equivalent already passes because pytest imposes no per-test cap; no backend/SDK behavior changes.
1 parent dc9d74f commit e63f0a4

2 files changed

Lines changed: 16 additions & 10 deletions

File tree

sdks/typescript/tests/integration.test.ts

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,10 @@ describe.skipIf(SKIP_TESTS)("OpenRAG TypeScript SDK Integration", () => {
199199
const betaPath = path.join(tmpDir, betaName);
200200
fs.writeFileSync(alphaPath, "# Alpha\n\nPurple elephants live here.\n");
201201
fs.writeFileSync(betaPath, "# Beta\n\nYellow tigers live here.\n");
202-
await client.documents.ingest({ filePath: alphaPath });
203-
await client.documents.ingest({ filePath: betaPath });
202+
await Promise.all([
203+
client.documents.ingest({ filePath: alphaPath }),
204+
client.documents.ingest({ filePath: betaPath }),
205+
]);
204206

205207
const createResult = await client.knowledgeFilters.create({
206208
name: `TS chat filter scope ${Date.now()}`,
@@ -234,7 +236,7 @@ describe.skipIf(SKIP_TESTS)("OpenRAG TypeScript SDK Integration", () => {
234236
await client.documents.delete(alphaName);
235237
await client.documents.delete(betaName);
236238
}
237-
}, 60_000);
239+
}, 180_000);
238240

239241
it("filterId in search actually scopes results to data_sources", async () => {
240242
const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), "sdk-filter-"));
@@ -244,8 +246,10 @@ describe.skipIf(SKIP_TESTS)("OpenRAG TypeScript SDK Integration", () => {
244246
const betaPath = path.join(tmpDir, betaName);
245247
fs.writeFileSync(alphaPath, "# Alpha\n\nPurple elephants live here.\n");
246248
fs.writeFileSync(betaPath, "# Beta\n\nYellow tigers live here.\n");
247-
await client.documents.ingest({ filePath: alphaPath });
248-
await client.documents.ingest({ filePath: betaPath });
249+
await Promise.all([
250+
client.documents.ingest({ filePath: alphaPath }),
251+
client.documents.ingest({ filePath: betaPath }),
252+
]);
249253

250254
const createResult = await client.knowledgeFilters.create({
251255
name: `TS search filter scope ${Date.now()}`,
@@ -275,7 +279,7 @@ describe.skipIf(SKIP_TESTS)("OpenRAG TypeScript SDK Integration", () => {
275279
await client.documents.delete(alphaName);
276280
await client.documents.delete(betaName);
277281
}
278-
}, 60_000);
282+
}, 180_000);
279283

280284
it("documents.delete(filterId) only removes filenames in the filter", async () => {
281285
const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), "sdk-filter-"));
@@ -285,8 +289,10 @@ describe.skipIf(SKIP_TESTS)("OpenRAG TypeScript SDK Integration", () => {
285289
const betaPath = path.join(tmpDir, betaName);
286290
fs.writeFileSync(alphaPath, "# Alpha\n\nPurple elephants.\n");
287291
fs.writeFileSync(betaPath, "# Beta\n\nYellow tigers.\n");
288-
await client.documents.ingest({ filePath: alphaPath });
289-
await client.documents.ingest({ filePath: betaPath });
292+
await Promise.all([
293+
client.documents.ingest({ filePath: alphaPath }),
294+
client.documents.ingest({ filePath: betaPath }),
295+
]);
290296

291297
const createResult = await client.knowledgeFilters.create({
292298
name: `TS delete-by-filter ${Date.now()}`,
@@ -321,7 +327,7 @@ describe.skipIf(SKIP_TESTS)("OpenRAG TypeScript SDK Integration", () => {
321327
await client.documents.delete(alphaName);
322328
await client.documents.delete(betaName);
323329
}
324-
}, 60_000);
330+
}, 180_000);
325331

326332
it("documents.delete rejects both filename and filterId together", async () => {
327333
await expect(

sdks/typescript/vitest.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { defineConfig } from "vitest/config";
33
export default defineConfig({
44
test: {
55
include: ["tests/**/*.test.ts"],
6-
testTimeout: 60000, // 60 second timeout for integration tests
6+
testTimeout: 120000, // 120 second timeout for integration tests
77
hookTimeout: 60000,
88
},
99
});

0 commit comments

Comments
 (0)