-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: websocket closed (tentative) #29347
Conversation
…ted errors as websocket in closing/closed state errors
Passing run #55090 ↗︎
Details:
Review all test suite changes for PR #29347 ↗︎ |
5a3e768
to
59a1198
Compare
Co-authored-by: Bill Glesias <[email protected]>
|
||
const WEBSOCKET_NOT_OPEN_RE = /^WebSocket is (?:not open|already in CLOSING or CLOSED state)/ | ||
const WEBSOCKET_NOT_OPEN_RE = /^WebSocket (?:connection closed|is (?:not open|already in CLOSING or CLOSED state))/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we document what the various messages are that we're covering here? I always like to have examples around regexes for my future self.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed in a613bca
Released in This comment thread has been locked. If you are still experiencing this issue after upgrading to |
Additional details
This is a tentative fix. This issue has been very difficult if not impossible to reproduce, and this is my best guess solution.
Occasionally, certain systems can send CDP commands that will fail due to the CRI websocket being closed with those commands mid-flight. This is most common with video recording ACK commands, but can potentially occur with any automation command. Prior to
[email protected]
, it seems as though these commands failed silently.0.33.0
introduced behavior where it will throw an error in this situation. This exception was uncaught, causing Cypress to intermittently exit with code 1 even thought a given spec had succeeded.This PR:
Error: WebSocket connection closed
errors similarly toWebSocket is not open
andWebSocket already in CLOSING or CLOSED state
errors: the command is enqueued, and reconnection to the CRI websocket is attemptedRuntime.addBinding
,DOM.enable
) from the command queue, if present, when sending them upon reconnection. This prevents them from being re-sent when iterating through the queued commands.Steps to test
Run server unit and integration tests. A reproduction of the original issue is unavailable, and confirmation on a fix will be pending user feedback.
How has the user experience changed?
PR Tasks
cypress-documentation
?type definitions
?