From 67dda132e607cb709ddd91987f7a874f7e2b615c Mon Sep 17 00:00:00 2001 From: leemour Date: Sat, 17 Oct 2026 04:11:32 +0200 Subject: [PATCH] test(server): isolate happy-path send from retry timing budget --- src/server/server.test.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/server/server.test.ts b/src/server/server.test.ts index 9408964a..3128afee 100644 --- a/src/server/server.test.ts +++ b/src/server/server.test.ts @@ -95,17 +95,20 @@ const serve = async ( startedByCommand?: boolean maxSubscriberBufferBytes?: number maxSubscriberTotalBufferBytes?: number + requestTimeoutMs?: number } = {}, ) => { const store = new SessionStore({ profile, keyring: memoryKeyring() }) store.writeToken("a-token") const notes: string[] = [] + const { requestTimeoutMs = 200, ...serverOptions } = extra const server = new MaxServer({ store, note: (line) => notes.push(line), - connection: (hooks) => new Connection({ ...hooks, live: true, createSocket: max.createSocket, timeoutMs: 200 }), + connection: (hooks) => + new Connection({ ...hooks, live: true, createSocket: max.createSocket, timeoutMs: requestTimeoutMs }), retryAfterMs: () => 0, - ...extra, + ...serverOptions, }) running.push(server) await server.start() @@ -609,9 +612,8 @@ describe("a command through max serve", () => { }) it("sends through the server too: one connection to MAX for everything", async () => { - const { store, max } = await serve("c-send") - // The reads after login first: sharing the 200 ms budget with them, the send timed out on CI and - // was retried with its cid — two MSG_SEND for one message. + // Coverage instrumentation can use the short retry fixtures' entire request budget. + const { store, max } = await serve("c-send", scripted(), { requestTimeoutMs: 2000 }) await tabReads(max) const { client, opened } = commandClient(store)