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

Fix race condition on TestConnectionAllowsConcurrentWrites #282

Merged
merged 1 commit into from
Jun 8, 2024

Conversation

tpaschalis
Copy link
Member

This PR fixes a race condition on TestConnectionAllowsConcurrentWrites.

Before this change, the select case here was a no-op and would always fall through to the default case; using a channel allows proper synchronization.

To validate the before/after behavior, one can use the following command from the repo root.

$ go test -run=TestConnectionAllowsConcurrentWrites ./... -count=10000 -shuffle=on -race

Fixes #280

Signed-off-by: Paschalis Tsilias <paschalis.tsilias@grafana.com>
@tpaschalis tpaschalis requested a review from a team June 7, 2024 21:10
@tigrannajaryan
Copy link
Member

@evan-bradley can you review as the author of the test?

Copy link

codecov bot commented Jun 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 75.96%. Comparing base (1a9603e) to head (4857e89).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #282   +/-   ##
=======================================
  Coverage   75.96%   75.96%           
=======================================
  Files          25       25           
  Lines        1656     1656           
=======================================
  Hits         1258     1258           
  Misses        291      291           
  Partials      107      107           

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

Copy link
Contributor

@evan-bradley evan-bradley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @tpaschalis.

@tigrannajaryan tigrannajaryan merged commit dc5742f into open-telemetry:main Jun 8, 2024
7 checks passed
@tigrannajaryan
Copy link
Member

Thank you @tpaschalis!

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.

TestConnectionAllowsConcurrentWrites is unstable
3 participants