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

tests: race in TestBlockCacheMutexes tests #6915

Closed
Roasbeef opened this issue Sep 14, 2022 · 0 comments · Fixed by #7029
Closed

tests: race in TestBlockCacheMutexes tests #6915

Roasbeef opened this issue Sep 14, 2022 · 0 comments · Fixed by #7029
Labels
data-race Related to data-races tests

Comments

@Roasbeef
Copy link
Member

Saw a test run fail w/ a race, looks like it's in the mock backend itself and not the actual code:

==================
WARNING: DATA RACE
Read at 0x00c0001ca2d8 by goroutine 108:
  github.com/lightningnetwork/lnd/blockcache.(*mockChainBackend).GetBlock()
      /home/runner/work/lnd/lnd/blockcache/blockcache_test.go:33 +0xda
  github.com/lightningnetwork/lnd/blockcache.(*mockChainBackend).GetBlock-fm()
      <autogenerated>:1 +0x44
  github.com/lightningnetwork/lnd/blockcache.(*BlockCache).GetBlock()
      /home/runner/work/lnd/lnd/blockcache/blockcache.go:52 +0x3b6
  github.com/lightningnetwork/lnd/blockcache.TestBlockCacheMutexes.func1()
      /home/runner/work/lnd/lnd/blockcache/blockcache_test.go:1[77](https://github.com/lightningnetwork/lnd/actions/runs/3011169890/jobs/4838020176#step:6:78) +0xb0
  github.com/lightningnetwork/lnd/blockcache.TestBlockCacheMutexes.func2()
      /home/runner/work/lnd/lnd/blockcache/blockcache_test.go:182 +0x47

Previous write at 0x00c0001ca2d8 by goroutine 51:
  github.com/lightningnetwork/lnd/blockcache.(*mockChainBackend).GetBlock()
      /home/runner/work/lnd/lnd/blockcache/blockcache_test.go:33 +0xf8
  github.com/lightningnetwork/lnd/blockcache.(*mockChainBackend).GetBlock-fm()
      <autogenerated>:1 +0x44
  github.com/lightningnetwork/lnd/blockcache.(*BlockCache).GetBlock()
      /home/runner/work/lnd/lnd/blockcache/blockcache.go:52 +0x3b6
  github.com/lightningnetwork/lnd/blockcache.TestBlockCacheMutexes.func1()
      /home/runner/work/lnd/lnd/blockcache/blockcache_test.go:174 +0x7b
  github.com/lightningnetwork/lnd/blockcache.TestBlockCacheMutexes.func2()
      /home/runner/work/lnd/lnd/blockcache/blockcache_test.go:1[82](https://github.com/lightningnetwork/lnd/actions/runs/3011169890/jobs/4838020176#step:6:83) +0x47

Goroutine 108 (running) created at:
  github.com/lightningnetwork/lnd/blockcache.TestBlockCacheMutexes()
      /home/runner/work/lnd/lnd/blockcache/blockcache_test.go:172 +0x824
  testing.tRunner()
      /opt/hostedtoolcache/go/1.19.0/x64/src/testing/testing.go:1446 +0x216
  testing.(*T).Run.func1()
      /opt/hostedtoolcache/go/1.19.0/x64/src/testing/testing.go:14[93](https://github.com/lightningnetwork/lnd/actions/runs/3011169890/jobs/4838020176#step:6:94) +0x47

Goroutine 51 (finished) created at:
  github.com/lightningnetwork/lnd/blockcache.TestBlockCacheMutexes()
      /home/runner/work/lnd/lnd/blockcache/blockcache_test.go:172 +0x824
  testing.tRunner()
      /opt/hostedtoolcache/go/1.19.0/x64/src/testing/testing.go:1446 +0x216
  testing.(*T).Run.func1()
      /opt/hostedtoolcache/go/1.19.0/x64/src/testing/testing.go:1493 +0x47
==================
--- FAIL: TestBlockCacheMutexes (0.01s)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
data-race Related to data-races tests
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant