-
Notifications
You must be signed in to change notification settings - Fork 388
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
Fix race condition in unit test for IPsec #4060
Conversation
Codecov Report
@@ Coverage Diff @@
## main #4060 +/- ##
==========================================
+ Coverage 64.09% 67.30% +3.21%
==========================================
Files 294 297 +3
Lines 44161 44434 +273
==========================================
+ Hits 28305 29908 +1603
+ Misses 13548 12167 -1381
- Partials 2308 2359 +51
|
signCh := make(chan struct{}) | ||
defer func() { | ||
<-signCh | ||
}() |
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.
if the next line returns an error, the code will block forever?
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.
Moved the defer func below the watcher error check. Thanks!
Wait for the signer goroutine to finish before quitting the tests. This ensures that the *testing.T is always valid in the signer. Fixes: antrea-io#4059 Signed-off-by: Xu Liu <[email protected]>
3dd2d30
to
593c0bc
Compare
pkg/agent/controller/ipseccertificate/ipsec_certificate_controller_test.go
Show resolved
Hide resolved
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
/skip-all |
/skip-conformance |
Wait for the signer goroutine to finish before quitting the tests.
This ensures that the *testing.T is always valid in the signer.
Fixes: #4059
Signed-off-by: Xu Liu [email protected]