Fix(dot/rpc/subscription): Implement WebSocket connection synchronization for testing#3399
Merged
axaysagathiya merged 10 commits intoChainSafe:developmentfrom Jul 25, 2023
Merged
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## development #3399 +/- ##
===============================================
+ Coverage 50.98% 51.25% +0.26%
===============================================
Files 231 231
Lines 30600 30600
===============================================
+ Hits 15602 15683 +81
+ Misses 13337 13258 -79
+ Partials 1661 1659 -2 |
c433f6f to
2beb1d4
Compare
EclesioMeloJunior
approved these changes
Jul 24, 2023
EclesioMeloJunior
requested changes
Jul 25, 2023
edwardmack
approved these changes
Jul 25, 2023
EclesioMeloJunior
approved these changes
Jul 25, 2023
|
🎉 This PR is included in version 0.8.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
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.
Changes
inside the
setupWSConnfunction, thehttptest.NewServerfunction starts an HTTP server with a custom handler, but it returns immediately after the server has been started. In some cases, the WebSocket connection might not be fully established by the time the test code reaches atwskt.Wsconn.Close(), resulting in a nil value for wskt.Wsconn, and the test fails.I have introduced a synchronization mechanism using a channel to ensure the WebSocket connection is fully established before proceeding with the test.
Tests
go test -tags integration github.com/ChainSafe/gossamerIssues
Closes #2944
Primary Reviewer
@timwu20 @EclesioMeloJunior