diff --git a/src/gateway/session-message-events.test.ts b/src/gateway/session-message-events.test.ts index 6d375f7dd2d..4d8f89de4f1 100644 --- a/src/gateway/session-message-events.test.ts +++ b/src/gateway/session-message-events.test.ts @@ -19,6 +19,7 @@ import { installGatewayTestHooks({ scope: "suite" }); const cleanupDirs: string[] = []; +const SETUP_RPC_TIMEOUT_MS = 30_000; let harness: Awaited>; let subscribedOperatorWs: | Awaited>["openWs"]>> @@ -30,13 +31,18 @@ beforeAll(async () => { delete process.env.OPENCLAW_TEST_MINIMAL_GATEWAY; harness = await createGatewaySuiteHarness(); subscribedOperatorWs = await harness.openWs(); - await connectOk(subscribedOperatorWs, { scopes: ["operator.read"] }); - await rpcReq(subscribedOperatorWs, "sessions.subscribe"); -}); + await connectOk(subscribedOperatorWs, { + scopes: ["operator.read"], + timeoutMs: SETUP_RPC_TIMEOUT_MS, + }); + await rpcReq(subscribedOperatorWs, "sessions.subscribe", undefined, SETUP_RPC_TIMEOUT_MS); +}, 60_000); afterAll(async () => { subscribedOperatorWs?.close(); - await harness.close(); + if (harness) { + await harness.close(); + } if (previousMinimalGateway === undefined) { delete process.env.OPENCLAW_TEST_MINIMAL_GATEWAY; } else {