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.

Screen Shot 2019-11-12 at 12 58 59 PM Screen Shot 2019-11-12 at 12 59 11 PM copy

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

Most upvoted comments

I get this if I leave cypress open while I make a coffee. Have to close the browser and click “run all specs” again

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.

  • Have Cypress open using cypress open in my project.
  • Put Mac to sleep
  • Wake Mac and rerun tests
Screen Shot 2020-02-24 at 3 29 08 PM

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