-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
[Bug]: Race condition in TestSpanCollectorHTTPS #4497
Comments
hey @yurishkuro, can the race conditions be due to the use of zaptest.logger(t) and the concurrent execution of tests from different packages, which are utilizing zaptest? I apologize if this question seems trivial, but I value your perspective greatly. |
We don't run tests concurrently, and zaptest is well designed to work in concurrent setting even if we did. I already posted my hypothesis for race condition in the ticket - doing logging after the test is finished. |
@yurishkuro I wasn't able to replicate it in my system. It just worked fine, though I had some other tests breaking. |
I also ran the test and obtained the same as @sbdtu5498 with all the test in TestSpanCollectorHTTPS in race condition passing. |
@Player256 this is a spurious issue, it's difficult to reproduce just by running tests a few times. The the stack dump in the issue has enough information to investigate. |
Adding a
|
hi i'm new here can anyone help me start contributing to this project I'm good at backend . |
## Which problem is this PR solving? - Resolves #4497 ## Short description of the changes - Do not use `zaptest.NewLogger(t)` because it causes race condition shown in the ticket when the server goroutine tries to log something that is being forwarded to `testing.T` while the test is being shutdown due to panic. - I was not able to get to the root cause why this happens, since the test is properly shutting down the server. This may indicate an issue in testing itself in how it handles panic. Signed-off-by: Yuri Shkuro <[email protected]>
…g#4546) ## Which problem is this PR solving? - Resolves jaegertracing#4497 ## Short description of the changes - Do not use `zaptest.NewLogger(t)` because it causes race condition shown in the ticket when the server goroutine tries to log something that is being forwarded to `testing.T` while the test is being shutdown due to panic. - I was not able to get to the root cause why this happens, since the test is properly shutting down the server. This may indicate an issue in testing itself in how it handles panic. Signed-off-by: Yuri Shkuro <[email protected]> Signed-off-by: KevinSchneider <[email protected]>
…g#4546) ## Which problem is this PR solving? - Resolves jaegertracing#4497 ## Short description of the changes - Do not use `zaptest.NewLogger(t)` because it causes race condition shown in the ticket when the server goroutine tries to log something that is being forwarded to `testing.T` while the test is being shutdown due to panic. - I was not able to get to the root cause why this happens, since the test is properly shutting down the server. This may indicate an issue in testing itself in how it handles panic. Signed-off-by: Yuri Shkuro <[email protected]> Signed-off-by: Afzal Ansari <[email protected]>
What happened?
Unit tests failed on a data race
Steps to reproduce
unknown, this seems spurious
Expected behavior
test should succeed
Relevant log output
Screenshot
No response
Additional context
This looks similar to another issue that happened a few months ago. The race happens inside standard
testing
lib related to deferred behavior. My suspicion is that we are shutting down a server that is running in a different goroutine (or even leaking it) and it's writing a log via zap/zaptest into testing.T after the test is finished. We may either be missingdefer server.close()
in the test or theclose()
actually returns before the server gorouting is stoppedJaeger backend version
No response
SDK
No response
Pipeline
No response
Stogage backend
No response
Operating system
No response
Deployment model
No response
Deployment configs
No response
The text was updated successfully, but these errors were encountered: