DevExpress / testcafe

A Node.js tool to automate end-to-end web testing.
https://testcafe.io
MIT License
9.82k stars 671 forks source link

Tests fail with "Error: WebSocket connection closed" for Chrome 130.0.6723.6 (2024-09-18) #8286

Open thomas-jakemeyn opened 1 week ago

thomas-jakemeyn commented 1 week ago

What is your Scenario?

We run the exact same 170+ TestCafe tests against the latest version of Chrome and Chrome Beta.

What is the Current behavior?

Our tests still pass for Chrome. However, the majority of them started failing for Chrome Beta with the stacktrace below after we upgraded to the version 130.0.6723.6. That version has been promoted to the Beta channel on September 18, 2024 (see here).

Error: WebSocket connection closed
at node_modules/chrome-remote-interface/lib/chrome.js:94:35
at Chrome._handleConnectionClose (node_modules/chrome-remote-interface/lib/chrome.js:256:13)
at WebSocket.<anonymous> (node_modules/chrome-remote-interface/lib/chrome.js:243:22)
at WebSocket.emit (node:events:519:28)
at WebSocket.emit (node:domain:488:12)
at WebSocket.emitClose (node_modules/ws/lib/websocket.js:246:10)
at Socket.socketOnClose (node_modules/ws/lib/websocket.js:1150:15)
at Socket.emit (node:events:519:28)
at Socket.emit (node:domain:488:12)
at TCP.<anonymous> (node:net:339:12)

What is the Expected behavior?

Running tests against Chrome 130.0.6723.6 should not trigger Error: WebSocket connection closed.

What is the public URL of the test page? (attach your complete example)

NA

What is your TestCafe test code?

NA

Your complete configuration file

No response

Your complete test report

No response

Screenshots

No response

Steps to Reproduce

1. 2. 3.

TestCafe version

3.6.2

Node.js version

No response

Command-line arguments

NA

Browser name(s) and version(s)

No response

Platform(s) and version(s)

No response

Other

No response

github-actions[bot] commented 1 week ago

Thank you for submitting a bug report. We would love to help you investigate the issue. Please share a simple code example that reliably reproduces the bug. For more information, read the following article: How To Create a Minimal Working Example When You Submit an Issue. We look forward to your response.

thomas-jakemeyn commented 1 week ago

I forgot to mention that this problem happens when running the tests in Docker (on TeamCity). I cannot reproduce it with a simple example. Hopefully this similar Cypress issue can shed some light on the matter.

thomas-jakemeyn commented 1 week ago

I just made an interesting observation... We have a test orchestration logic that runs every spec file in a separate Docker container (one container is in charge of executing one spec file). We can control the level of parallelism (aka the maximum number of test containers that can run at the same time). If I set PARALLEL = 1 for Chrome Beta (aka if I force a sequential execution), then I don't get the error (but executing the tests takes 1h 13m instead of 14m). For Chrome, the tests are successful with PARALLEL = 7 (everything is the same, just the browser is different)...

mikejamesthompson commented 1 week ago

Could this be related to #8258?

thomas-jakemeyn commented 1 week ago

I quickly checked our codebase and we don't launch any sub-window while executing the TestCafe tests.

github-actions[bot] commented 4 days ago

We appreciate you taking the time to share information about this issue. We reproduced the bug and added this ticket to our internal task queue. We'll update this thread once we have news.