fix(gateway): reduce flaky ws rpc timeouts
This commit is contained in:
1 parent
4af8228c34
commit
1089444807
12 files changed
+4
-1
No files matched your search
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user