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

go test -race ./... fails with races detected #3482

Open
dmitris opened this issue Feb 9, 2024 · 1 comment
Open

go test -race ./... fails with races detected #3482

dmitris opened this issue Feb 9, 2024 · 1 comment
Assignees
Labels

Comments

@dmitris
Copy link
Contributor

dmitris commented Feb 9, 2024

go test -race ./... run in the repo root fails with races detected -
https://gist.github.com/dmitris/d816f41bb12bd99d485e917d8728c320
Do you know any background or history on that? Is it expected? We stumbled on this trying to build the repo in our CI which has the testrace step.

partial excerpt:

==================
WARNING: DATA RACE
Read at 0x00c00057a510 by goroutine 152:
  github.com/prebid/prebid-server/v2/floors.TestFetcherWhenRequestGetSameURLInrequest.func2()
      /Users/dmitris/gh/prebid/prebid-server/floors/fetcher_test.go:837 +0x34
  github.com/stretchr/testify/assert.Never.func1()
      /Users/dmitris/go/pkg/mod/github.com/stretchr/testify@v1.8.1/assert/assertions.go:1782 +0x38

Previous write at 0x00c00057a510 by goroutine 143:
  github.com/prebid/prebid-server/v2/floors.(*FetchQueue).Push()
      /Users/dmitris/gh/prebid/prebid-server/floors/fetcher.go:72 +0xe8
  container/heap.Push()
      /usr/local/go/src/container/heap/heap.go:52 +0x48
  github.com/prebid/prebid-server/v2/floors.(*PriceFloorFetcher).Fetcher()
      /Users/dmitris/gh/prebid/prebid-server/floors/fetcher.go:212 +0x280
  github.com/prebid/prebid-server/v2/floors.mockFetcherInstance.gowrap1()
      /Users/dmitris/gh/prebid/prebid-server/floors/fetcher_test.go:790 +0x34

Goroutine 152 (running) created at:
  github.com/stretchr/testify/assert.Never()
      /Users/dmitris/go/pkg/mod/github.com/stretchr/testify@v1.8.1/assert/assertions.go:1782 +0x2cc
  github.com/prebid/prebid-server/v2/floors.TestFetcherWhenRequestGetSameURLInrequest()
      /Users/dmitris/gh/prebid/prebid-server/floors/fetcher_test.go:837 +0x3fc
  testing.tRunner()
      /usr/local/go/src/testing/testing.go:1689 +0x180
  testing.(*T).Run.gowrap1()
      /usr/local/go/src/testing/testing.go:1742 +0x40

Goroutine 143 (running) created at:
  github.com/prebid/prebid-server/v2/floors.mockFetcherInstance()
      /Users/dmitris/gh/prebid/prebid-server/floors/fetcher_test.go:790 +0x284
  github.com/prebid/prebid-server/v2/floors.TestFetcherWhenRequestGetSameURLInrequest()
      /Users/dmitris/gh/prebid/prebid-server/floors/fetcher_test.go:816 +0x228
  testing.tRunner()
      /usr/local/go/src/testing/testing.go:1689 +0x180
  testing.(*T).Run.gowrap1()
      /usr/local/go/src/testing/testing.go:1742 +0x40
==================
@SyntaxNode
Copy link
Contributor

It's not expected. Looks like this was recently introduced in tests for the Floors feature. Is this the only data race found?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Ready for Dev
Development

No branches or pull requests

4 participants