Fix intermittent unit test failures#780
Merged
adrianosela merged 1 commit intopion:masterfrom Jan 21, 2026
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #780 +/- ##
==========================================
+ Coverage 81.61% 81.68% +0.06%
==========================================
Files 105 105
Lines 5837 5837
==========================================
+ Hits 4764 4768 +4
+ Misses 689 686 -3
+ Partials 384 383 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
f37ea89 to
b579e32
Compare
b579e32 to
374503e
Compare
374503e to
317672f
Compare
Fix two intermittent test failures caused by race conditions and
resource leaks:
pipeConn goroutine leak (conn_test.go:208, 225-228):
- Made resultCh buffered to prevent goroutine blocking
- Added cleanup to read from channel and close client connection
when server handshake fails, preventing goroutine leak
TestPSKServerKeyExchange data race (conn_test.go:806-865):
- Changed gotServerKeyExchange from bool to atomic.Bool to
eliminate data race between callback goroutine and test goroutine
- Explicitly captured test case variables to prevent closure issues
- Read atomic value immediately after handshake completes, before
closing connections, to avoid timing-dependent failures
317672f to
1ad967d
Compare
JoTurk
approved these changes
Jan 21, 2026
Contributor
Author
|
Just running the tests a few times to make sure these errors don't appear again in CI (as I only tested on my macbook). |
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.
Fix intermittent unit test failures
Fixes two intermittent test failures caused by race conditions and resource leaks:
TestNetTest bug on pipeConn goroutine leak (conn_test.go:208, 225-228):
Tested before and after with
go test -run 'TestNetTest*' -v -count 20Before failed 4/20 times, after none.
TestPSKServerKeyExchange data race (conn_test.go:806-865):