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: data race in distributor tests #15423

Merged
merged 1 commit into from
Dec 16, 2024
Merged

fix: data race in distributor tests #15423

merged 1 commit into from
Dec 16, 2024

Conversation

na--
Copy link
Member

@na-- na-- commented Dec 16, 2024

What this PR does / why we need it:

Tiny data race in the tests itself, without this fix the tests (when executed with -race) fail with:

WARNING: DATA RACE
Read at 0x00c00187a6a8 by goroutine 10064:
  github.com/grafana/loki/v3/pkg/distributor.TestDistributorPushToKafka.func3.1()
      github.com/grafana/loki/v3/pkg/distributor/distributor_test.go:586 +0x48
  github.com/stretchr/testify/assert.Eventually.func1()
      github.com/stretchr/[email protected]/assert/assertions.go:1949 +0x33

Previous write at 0x00c00187a6a8 by goroutine 9930:
  github.com/grafana/loki/v3/pkg/distributor.(*mockIngester).Push()
      github.com/grafana/loki/v3/pkg/distributor/distributor_test.go:1872 +0x3c4
  github.com/grafana/loki/v3/pkg/distributor.(*Distributor).sendStreamsErr()
      github.com/grafana/loki/v3/pkg/distributor/distributor.go:1035 +0x3af
...

@na-- na-- requested a review from a team as a code owner December 16, 2024 08:30
@na-- na-- merged commit b8168a8 into main Dec 16, 2024
60 checks passed
@na-- na-- deleted the ned/fix-data-race-03 branch December 16, 2024 10:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants