diff --git a/src/memory/__tests__/http.test.ts b/src/memory/__tests__/http.test.ts index 70af182f6c..7bb957a0e9 100644 --- a/src/memory/__tests__/http.test.ts +++ b/src/memory/__tests__/http.test.ts @@ -49,7 +49,17 @@ async function connect( return client; } -describe("Streamable HTTP", () => { +// These cases drive a real endpoint over real sockets, and the first one also +// pays the client's first connect. Measured on Windows CI (#5570): a median of +// 140 ms for the first case and never 1 s in 1,040 runs of the suite, yet one +// leg in 56 timed out at Vitest's 5 s default, on a runner so slow that the +// whole suite took five times its median. Nothing in the endpoint or the file +// lock waited; every test was slow at once, and the ones with the most round +// trips crossed the limit. The limit is here to catch a hang, so it sits well +// clear of a slow runner. +const REAL_ENDPOINT_TIMEOUT_MS = 30_000; + +describe("Streamable HTTP", { timeout: REAL_ENDPOINT_TIMEOUT_MS }, () => { let running: RunningHttpServer | undefined; let graph: Awaited>; diff --git a/src/memory/__tests__/write-limits.test.ts b/src/memory/__tests__/write-limits.test.ts index 4e81d934a8..c7bd4efdfd 100644 --- a/src/memory/__tests__/write-limits.test.ts +++ b/src/memory/__tests__/write-limits.test.ts @@ -300,7 +300,12 @@ describe("write limits", () => { }); }); -describe("write limits over Streamable HTTP", () => { +// A real endpoint over real sockets, and this file's first client connect. On +// Windows CI it takes a median of 72 ms and never took 1 s in 1,040 runs of +// the suite, but it timed out once at Vitest's 5 s default, on a runner that +// slowed the whole suite fivefold (#5570; `http.test.ts` has the detail). The +// limit is here to catch a hang, so it sits well clear of a slow runner. +describe("write limits over Streamable HTTP", { timeout: 30_000 }, () => { it("holds the endpoint's write tools to the limits it was given", async () => { vi.spyOn(console, "error").mockImplementation(() => {}); const { filePath, cleanup } = await makeTempGraph();