fix(gateway): reduce flaky ws rpc timeouts

This commit is contained in:
Peter Steinberger
2026-01-14 05:41:02 +00:00
parent 4af8228c34
commit 1089444807
12 changed files with 4 additions and 1 deletions

View File

@@ -147,7 +147,10 @@ export async function occupyPort(): Promise<{
export function onceMessage<T = unknown>(
ws: WebSocket,
filter: (obj: unknown) => boolean,
timeoutMs = 3000,
// Full-suite runs can saturate the event loop (581+ files). Keep this high
// enough to avoid flaky RPC timeouts, but still fail fast when a response
// never arrives.
timeoutMs = 10_000,
): Promise<T> {
return new Promise<T>((resolve, reject) => {
const timer = setTimeout(() => reject(new Error("timeout")), timeoutMs);