-
Notifications
You must be signed in to change notification settings - Fork 58
Add concurrent websocket session test #887
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
base: test-comm
Are you sure you want to change the base?
Add concurrent websocket session test #887
Conversation
Websocket connects may be used by multiple goroutines concurrently. This commit adds a test to stress the session handling, open, send, receive, and eventual close. Signed-off-by: Marcus Brandenburger <[email protected]>
@mbrandenburger , please, can you fill also the PR's fields |
} | ||
|
||
func shutdown(nodes ...Node) { | ||
// TODO: how to check that the comm service is actually stopped? |
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.
Stop normally waits. What is it that's failing? Maybe the connections that are not done sending?
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.
See bug description in #884
}).Should(Succeed()) | ||
|
||
// close | ||
aliceSession.Close() |
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.
While writing this test, did you notice the logs were giving confusing messages? Or that we didn't shut down gracefully?
Maybe we should think of more test cases. For instance if we close the channel instead of sending back pong, what do we expect to receive on the other end?
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.
While writing this test, did you notice the logs were giving confusing messages? Or that we didn't shut down gracefully?
Oh the test log is wilde and outputs many warnings. Example:
2025-04-11 13:03:03.957 CEST 9c66 WARN [view-sdk.services.comm.rest.host] readMessages -> Context for stream [5E1V9rQHbsYVziNe7bHPJktJjyQBQTjYYhucotHcmEr.127.0.0.1:57126.BnsK7rcN3qKRV8y7LYUyWE0jEbfTsauQ.] closed by us. Error: %!w(*errors.errorString=&{context canceled})
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.
LGTM
Thanks for writing the test. I think we should test this component more thoroughly.
Websocket connects may be used by multiple goroutines concurrently. This commit adds a test to stress the session handling, open, send, receive, and eventual close.
The test added here triggers the issue reported in #884.