Skip to content
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

[chore] Remove redundant wait group from a test #10269

Merged
merged 2 commits into from
May 30, 2024

Conversation

dmitryax
Copy link
Member

https://github.com/open-telemetry/opentelemetry-collector/pull/10258/files#r1621017272 made me wonder if the wait group is really necessary. We have another synchronization that waits for at least two requests to enter the merge function, which should be enough. So, we don't necessarily need this wait group.

@dmitryax dmitryax requested a review from a team as a code owner May 30, 2024 17:42
@dmitryax dmitryax requested a review from mx-psi May 30, 2024 17:42
Copy link

codecov bot commented May 30, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.49%. Comparing base (1749a8f) to head (435fb3f).

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #10269      +/-   ##
==========================================
- Coverage   92.50%   92.49%   -0.02%     
==========================================
  Files         387      387              
  Lines       18259    18259              
==========================================
- Hits        16890    16888       -2     
- Misses       1024     1025       +1     
- Partials      345      346       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@bogdandrutu
Copy link
Member

We have another synchronization that waits for at least two requests to enter the merge function, which should be enough. So, we don't necessarily need this wait group.

This may fail goleak, because some of the started go routines may not finish until the end of the test.

@dmitryax
Copy link
Member Author

This may fail goleak, because some of the started go routines may not finish until the end of the test.

Makes sense. I simplified the test to keep only two goroutines that must finish once the batcher is shut down. This also makes the test deterministic

@codeboten codeboten merged commit 4bbb604 into open-telemetry:main May 30, 2024
48 checks passed
@github-actions github-actions bot added this to the next release milestone May 30, 2024
@dmitryax dmitryax deleted the remove-redundant-wg branch May 30, 2024 21:22
steves-canva pushed a commit to Canva/opentelemetry-collector that referenced this pull request Jun 14, 2024
https://github.com/open-telemetry/opentelemetry-collector/pull/10258/files#r1621017272
made me wonder if the wait group is really necessary. We have another
synchronization that waits for at least two requests to enter the merge
function, which should be enough. So, we don't necessarily need this
wait group.

Co-authored-by: Alex Boten <223565+codeboten@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants