cypress: WebSocket is not open: readyState 3 (CLOSED) error when watching test files
Current behavior:
I edited and saved a test file and got this error printed to the Command Log.
WebSocket is not open: readyState 3 (CLOSED)
The error did not disappear upon refresh / reload. I had to kill the Cypress process and restart. Was fixed after this.
Steps to reproduce: (app code and test code)
Unfortunately this did not happen again, so I don’t know what may have caused this. Documenting for anyone that captures more DEBUG logs in the future.
Versions
3.6.1
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 5
- Comments: 26 (11 by maintainers)
Commits related to this issue
- wip: reconnect to CDP automatically i think we should not do this, see: https://github.com/cypress-io/cypress/issues/5685\#issuecomment-589732584 — committed to cypress-io/cypress by flotwig 4 years ago
- Reconnect to CDP on WebSocket failure (#6532) * wip: reconnect to CDP automatically i think we should not do this, see: https://github.com/cypress-io/cypress/issues/5685\#issuecomment-589732584 ... — committed to cypress-io/cypress by flotwig 4 years ago
a mocha ?
I’ve seen this multiple times. It seems to happen when I leave the browser open for an extended period of time (usually overnight between working sessions). When I try to run the tests again, I get this error and need to close and re-open the browser for tests to run.
Steps to reproduce
So this happens definitely after I have put my Mac to sleep.
cypress openin my project.There may be some other situations this happens, particularly since I’ve seen Windows users mention this, but for some reason the connection is being disconnected. Anyways, it’s good news that we have a way to reproduce because now we can verify a fix!
just checked. Issue still occurring for 3.8.1
i am facing this with 3.8.0 too when i run 50 test cases it weirdly starts happening after 10-15 test case runs