mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 07:40:44 +00:00
test(gateway): harden session event setup timeout
This commit is contained in:
@@ -19,6 +19,7 @@ import {
|
||||
installGatewayTestHooks({ scope: "suite" });
|
||||
|
||||
const cleanupDirs: string[] = [];
|
||||
const SETUP_RPC_TIMEOUT_MS = 30_000;
|
||||
let harness: Awaited<ReturnType<typeof createGatewaySuiteHarness>>;
|
||||
let subscribedOperatorWs:
|
||||
| Awaited<ReturnType<Awaited<ReturnType<typeof createGatewaySuiteHarness>>["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 {
|
||||
|
||||
Reference in New Issue
Block a user