-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 data race in periodic reader tests #4731
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #4731 +/- ##
=======================================
- Coverage 81.8% 81.7% -0.1%
=======================================
Files 224 224
Lines 18113 18113
=======================================
- Hits 14817 14815 -2
- Misses 3000 3002 +2
Partials 296 296 |
ae87ed9
to
012cd2b
Compare
I think that some tests also miss shutdown of the reader which also can bring problems.
|
Added shutdowns to the two you mention. Since tests are run serially, it doesn't seem to matter, but good to do anyways. before:
after:
|
Fixes #4543
The Reader is already being initialized in the individual tests, e.g.
opentelemetry-go/sdk/metric/reader_test.go
Lines 56 to 57 in 47ba653
The creation of an additional reader during registration causes problems because the extra reader was being overwritten in the test, and thus never properly Shutdown(). The run() goroutine from the reader was still active during other tests, and could race with them.