8000 Fix race condition in ringbuf_test.go by mariomac · Pull Request #1835 · grafana/beyla · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix race condition in ringbuf_test.go #1835

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

Merged
merged 5 commits into from
Apr 15, 2025
Merged

Conversation

mariomac
Copy link
Contributor

Despite the readerFactory = oldReaderFactory assignment was protected behind a Mutex, the global variable is still accessed for read in the original ForwardRingbuf goroutine. This caused that often the Race detector complained when the tests were shut down.

Good news is that we can get rid of the code to restore the original readerFactory, since the Go test runtime restores it between test cases.

@mariomac mariomac requested a review from a team as a code owner April 15, 2025 12:54
Copy link
codecov bot commented Apr 15, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 67.89%. Comparing base (ff386fe) to head (680fdde).
Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1835      +/-   ##
==========================================
+ Coverage   67.57%   67.89%   +0.31%     
==========================================
  Files         225      225              
  Lines       22953    22953              
==========================================
+ Hits        15511    15584      +73     
+ Misses       6661     6589      -72     
+ Partials      781      780       -1     
Flag Coverage Δ
integration-test 55.15% <ø> (+0.09%) ⬆️
k8s-integration-test 53.58% <ø> (+0.55%) ⬆️
oats-test 35.01% <ø> (ø)
unittests 43.78% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor
@grcevski grcevski left a comment

Choose a reason for hiding this comment

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

LGTM!

@mariomac mariomac merged commit ae808b9 into grafana:main Apr 15, 2025
13 checks passed
@mariomac mariomac deleted the fix-rb-test-race branch April 15, 2025 15:28
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.

2 participants
0