test: make failed-opening-handshake websocket test deterministic#5233
Closed
test: make failed-opening-handshake websocket test deterministic#5233
Conversation
Signed-off-by: Matteo Collina <hello@matteocollina.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5233 +/- ##
=======================================
Coverage 93.27% 93.27%
=======================================
Files 110 110
Lines 36353 36353
=======================================
Hits 33909 33909
Misses 2444 2444 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
KhafraDev
reviewed
May 6, 2026
Member
KhafraDev
left a comment
There was a problem hiding this comment.
The tests seem to be fundamentally different. In the new test, a connection was opened, where the previous test's purpose was to test before we have a connection.
Member
Author
I'm not sure how to make that test not flaky. |
Member
|
I have no idea either :( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes a flaky websocket test by replacing an environment-dependent failed connection with a deterministic failed opening handshake against a local HTTP server.
Changes
test/websocket/issue-3697-2399493917.jstotest/websocket/failed-opening-handshake-ready-state.jswss://localhostwith a local127.0.0.1HTTP server that responds with404CLOSEDFixes #5223
Testing
node --test test/websocket/failed-opening-handshake-ready-state.jsnpx borp --timeout 180000 -p "test/websocket/failed-opening-handshake-ready-state.js"npm run test:websocket