From 68d8bd1788b63c7c4bc3cc6b7033a84cb80bfd06 Mon Sep 17 00:00:00 2001 From: Federico Jaramillo Martinez Date: Fri, 17 Jul 2026 22:56:17 +0200 Subject: [PATCH] test: stabilize fileTreeService truncation test on slow filesystems --- src/server/workspaces/fileTreeService.test.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/server/workspaces/fileTreeService.test.ts b/src/server/workspaces/fileTreeService.test.ts index 9af5e5c..bb4609a 100644 --- a/src/server/workspaces/fileTreeService.test.ts +++ b/src/server/workspaces/fileTreeService.test.ts @@ -81,6 +81,8 @@ describe("listWorkspaceTree", () => { await expect(listWorkspaceTree(root, "/tmp")).rejects.toThrow("Absolute paths are not allowed"); }); + // Writing MAX_ENTRIES + 1 files is inherently I/O-heavy; slow filesystems (notably + // Windows CI) can exceed Vitest's default 5s timeout, so give this case extra headroom. it("marks responses as truncated after the service entry limit", async () => { const root = await tempWorkspace(); await Promise.all(Array.from({ length: 1001 }, (_, index) => writeFile(join(root, `${String(index).padStart(4, "0")}.txt`), ""))); @@ -89,7 +91,7 @@ describe("listWorkspaceTree", () => { expect(tree.entries).toHaveLength(1000); expect(tree.truncated).toBe(true); - }); + }, 30_000); }); async function trySymlink(target: string, path: string): Promise {