-
Notifications
You must be signed in to change notification settings - Fork 81
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
rpcsrv: enforce WS connection close on test cleanup #3398
Conversation
fc3e9dc
to
a1ca8ab
Compare
Do not wait until wsReader routine gracefully finishes its work before WS connection close. Instead, firstly close the connection, and after that wait for proper wsReader exit. It's a harsh way, but I don't have any other options to try, because wsReader routine hangs on `ws.ReadMessage()` operation for more than ReadDeadline (more than 5 seconds) during test cleanup which results in the test timeout. Close #3378. Signed-off-by: Anna Shaleva <[email protected]>
a1ca8ab
to
e5c919f
Compare
Let's firstly see if it helps. If not, then I'm likely wrong about the reason of timeout. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #3398 +/- ##
==========================================
- Coverage 84.78% 84.78% -0.01%
==========================================
Files 331 331
Lines 44972 44972
==========================================
- Hits 38131 38128 -3
- Misses 5328 5330 +2
- Partials 1513 1514 +1 ☔ View full report in Codecov by Sentry. |
Nice, Coverage tests are PASSed, but the Codecove uploading step itself fails:
|
OK, it may happen due to the fact that this PR is based on a very fresh master, and Codecov results are not yet properly uploaded for the base. Not critical for us, may happen from time to time. |
ws.Close() | ||
<-readerToExitCh |
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.
The only thing I'm worried about is the fact that we have a similar usage pattern in our WS client. It's not exactly similar, because it's wsWriter
goroutine who is responsible for connection closing, but still, I don't quite understand the reason of WS read process hanging given the fact that we have timeout set. But we have tests for WS client closing process, and it passes on Windows, so likely there's no problem in real code.
Do not wait until wsReader routine gracefully finishes its work before WS connection close. Instead, firstly close the connection, and after that wait for proper wsReader exit.
It's a harsh way, but I don't have any other options to try, because wsReader routine hangs on
ws.ReadMessage()
operation for more than ReadDeadline (more than 5 seconds) during test cleanup which results in the test timeout.Close #3378.