Skip to content

Bug 2100702 - [firefox-mcp] Raise the WebSocket open limit and the default test timeout - #265

Open
juliandescottes wants to merge 3 commits into
mozilla:mainfrom
juliandescottes:bug-2100702-websocket-and-test-timeouts
Open

juliandescottes wants to merge 3 commits into
mozilla:mainfrom
juliandescottes:bug-2100702-websocket-and-test-timeouts

Conversation

@juliandescottes

@juliandescottes juliandescottes commented Dec 3, 2026 •

Copy link
Copy Markdown
Collaborator

Bug 2100702

This PR has 2 commits:

  1. The same commit as Bug 2100702 - [firefox-mcp] Wait up to 30 seconds for the BiDi WebSocket to open #264: wait up to 30 seconds for the BiDi WebSocket to open, instead of 5.
  2. Raise the default vitest test timeout from 5 to 30 seconds.

Tests without an explicit timeout used the vitest default of 5 seconds. Tests which start or restart Firefox, such as restricted-session-restart.test.ts, take 3.6 to 4.8 seconds on Windows CI when they pass, and fail when a slow startup pushes them over 5 seconds. Explicit timeouts on single tests still apply.

This PR and #264 are opened separately to compare their Windows CI results.

…ket 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.
Tests without an explicit timeout used the vitest default of 5 seconds.
Tests which start or restart Firefox, such as
restricted-session-restart.test.ts, take 3.6 to 4.8 seconds on Windows
CI when they pass, and failed when a slow startup pushed them over 5
seconds.

Explicit timeouts on single tests still apply.
@juliandescottes juliandescottes added the run-integration Trigger integration tests for a PR label Dec 3, 2026
… context test

The test starts Firefox with its first tool call. On Windows CI it takes
4.8 to 5.7 seconds, and sometimes went over its explicit 10 second
limit. Use the default test timeout of 30 seconds instead.
@juliandescottes

Copy link
Copy Markdown
Collaborator Author

@hbenl there was a recent increase in flakiness for CI jobs on windows, can you take a look at this PR?

Comment thread src/firefox/bidi.ts
* Wait for WebSocket to be in OPEN state
*/
private async waitForWebSocketOpen(ws: any, timeout: number = 5000): Promise<void> {
private async waitForWebSocketOpen(ws: any, timeout: number = 30000): Promise<void> {

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the only non-test change. Maybe 30s is excessive in general and should be reserved for CI jobs known to run on slow workers?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

run-integration Trigger integration tests for a PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant