Skip to content

Commit 08f87f0

Browse files
cliffhallclaude
andcommitted
fix(memory): give the real-endpoint HTTP tests a timeout clear of a slow runner
Two Streamable HTTP tests timed out at Vitest's 5 s default on one Windows CI leg in 56. Measured over 1,040 runs of the suite on 13 Windows runners, they take a median of 140 ms and 72 ms and never reached 1 s; the lock was always taken on the first try and the save's rename took at most 11 ms. In the failed leg the whole suite ran five times slower than its median, with in-memory tests slowed as much as the HTTP ones, so the cause is the runner, and the tests with the most round trips crossed the limit. Both describes now carry an explicit 30 s timeout with the measurements. Closes #5570 Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: cliffhall <cliff@futurescale.com>
1 parent 7f383a8 commit 08f87f0

2 files changed

Lines changed: 17 additions & 2 deletions

File tree

‎src/memory/__tests__/http.test.ts‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,17 @@ async function connect(
4949
return client;
5050
}
5151

52-
describe("Streamable HTTP", () => {
52+
// These cases drive a real endpoint over real sockets, and the first one also
53+
// pays the client's first connect. Measured on Windows CI (#5570): a median of
54+
// 140 ms for the first case and never 1 s in 1,040 runs of the suite, yet one
55+
// leg in 56 timed out at Vitest's 5 s default, on a runner so slow that the
56+
// whole suite took five times its median. Nothing in the endpoint or the file
57+
// lock waited; every test was slow at once, and the ones with the most round
58+
// trips crossed the limit. The limit is here to catch a hang, so it sits well
59+
// clear of a slow runner.
60+
const REAL_ENDPOINT_TIMEOUT_MS = 30_000;
61+
62+
describe("Streamable HTTP", { timeout: REAL_ENDPOINT_TIMEOUT_MS }, () => {
5363
let running: RunningHttpServer | undefined;
5464
let graph: Awaited<ReturnType<typeof makeTempGraph>>;
5565

‎src/memory/__tests__/write-limits.test.ts‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,12 @@ describe("write limits", () => {
300300
});
301301
});
302302

303-
describe("write limits over Streamable HTTP", () => {
303+
// A real endpoint over real sockets, and this file's first client connect. On
304+
// Windows CI it takes a median of 72 ms and never took 1 s in 1,040 runs of
305+
// the suite, but it timed out once at Vitest's 5 s default, on a runner that
306+
// slowed the whole suite fivefold (#5570; `http.test.ts` has the detail). The
307+
// limit is here to catch a hang, so it sits well clear of a slow runner.
308+
describe("write limits over Streamable HTTP", { timeout: 30_000 }, () => {
304309
it("holds the endpoint's write tools to the limits it was given", async () => {
305310
vi.spyOn(console, "error").mockImplementation(() => {});
306311
const { filePath, cleanup } = await makeTempGraph();

0 commit comments

Comments
 (0)