From 548376a065500e3631b572d5afe2af455482eb0d Mon Sep 17 00:00:00 2001 From: Julian Descottes Date: Thu, 3 Dec 2026 10:46:36 +0100 Subject: [PATCH] Bug 2100702 - [firefox-mcp] Wait up to 30 seconds for the BiDi WebSocket to open The first BiDi command opens the WebSocket. On Windows CI, opening it after a slow Firefox startup sometimes took more than the 5 second limit, and the connection failed with "Timeout waiting for WebSocket to open". Measured on Windows CI: median 187 ms, 90% under 1.4 s, maximum over 5 s. No test: a real Firefox cannot be made to open the WebSocket slowly on demand. --- src/firefox/bidi.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/firefox/bidi.ts b/src/firefox/bidi.ts index 051d0fe..cf0e487 100644 --- a/src/firefox/bidi.ts +++ b/src/firefox/bidi.ts @@ -317,7 +317,7 @@ export class BiDiFacade extends EventEmitter { /** * Wait for WebSocket to be in OPEN state */ - private async waitForWebSocketOpen(ws: any, timeout: number = 5000): Promise { + private async waitForWebSocketOpen(ws: any, timeout: number = 30000): Promise { // Already open if (ws.readyState === 1) { return;