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

Some tests fail with data races #23848

Closed
piersy opened this issue Nov 2, 2021 · 3 comments · Fixed by #24058
Closed

Some tests fail with data races #23848

piersy opened this issue Nov 2, 2021 · 3 comments · Fixed by #24058
Assignees
Labels

Comments

@piersy
Copy link
Contributor

piersy commented Nov 2, 2021

System information

Geth version: geth version

Geth
Version: 1.10.11-stable
Git Commit: 7231b3efb8095d3dd18d7164c3fa84d7705759d3
Architecture: amd64
Go Version: go1.17.1
Operating System: darwin
GOPATH=/Users/piersy/go
GOROOT=go

OS & Version: OSX

Expected behaviour

Tests should not encounter data races

Actual behaviour

Some tests do encounter data races, logs below:

vflux/client

==================
WARNING: DATA RACE
Write at 0x00c0002f8090 by goroutine 56:
  github.com/ethereum/go-ethereum/les/vflux/client.(*ServerPoolTest).run()
      /Users/piersy/projects/go-ethereum/les/vflux/client/serverpool_test.go:237 +0x108
  github.com/ethereum/go-ethereum/les/vflux/client.testServerPool()
      /Users/piersy/projects/go-ethereum/les/vflux/client/serverpool_test.go:299 +0x9b
  github.com/ethereum/go-ethereum/les/vflux/client.TestServerPoolWithPreNeg()
      /Users/piersy/projects/go-ethereum/les/vflux/client/serverpool_test.go:292 +0x35
  testing.tRunner()
      /usr/local/go/src/testing/testing.go:1259 +0x22f
  testing.(*T).Run·dwrap·21()
      /usr/local/go/src/testing/testing.go:1306 +0x47

Previous read at 0x00c0002f8090 by goroutine 23:
  github.com/ethereum/go-ethereum/les/vflux/client.(*ServerPoolTest).start.func1()
      /Users/piersy/projects/go-ethereum/les/vflux/client/serverpool_test.go:115 +0x152
  github.com/ethereum/go-ethereum/les/vflux/client.(*ServerPool).addPreNegFilter.func1.1()
      /Users/piersy/projects/go-ethereum/les/vflux/client/serverpool.go:275 +0x65

Goroutine 56 (running) created at:
  testing.(*T).Run()
      /usr/local/go/src/testing/testing.go:1306 +0x726
  testing.runTests.func1()
      /usr/local/go/src/testing/testing.go:1598 +0x99
  testing.tRunner()
      /usr/local/go/src/testing/testing.go:1259 +0x22f
  testing.runTests()
      /usr/local/go/src/testing/testing.go:1596 +0x7ca
  testing.(*M).Run()
      /usr/local/go/src/testing/testing.go:1504 +0x9d1
  main.main()
      _testmain.go:87 +0x22b

Goroutine 23 (running) created at:
  github.com/ethereum/go-ethereum/les/vflux/client.(*ServerPool).addPreNegFilter.func1()
      /Users/piersy/projects/go-ethereum/les/vflux/client/serverpool.go:274 +0x293
  github.com/ethereum/go-ethereum/p2p/nodestate.(*NodeStateMachine).setState.func1()
      /Users/piersy/projects/go-ethereum/p2p/nodestate/nodestate.go:687 +0x165
  github.com/ethereum/go-ethereum/p2p/nodestate.(*NodeStateMachine).opFinish()
      /Users/piersy/projects/go-ethereum/p2p/nodestate/nodestate.go:722 +0x1e1
  github.com/ethereum/go-ethereum/p2p/nodestate.(*NodeStateMachine).SetState()
      /Users/piersy/projects/go-ethereum/p2p/nodestate/nodestate.go:633 +0x211
  github.com/ethereum/go-ethereum/les/vflux/client.(*FillSet).readLoop()
      /Users/piersy/projects/go-ethereum/les/vflux/client/fillset.go:81 +0x9e
  github.com/ethereum/go-ethereum/les/vflux/client.NewFillSet·dwrap·1()
      /Users/piersy/projects/go-ethereum/les/vflux/client/fillset.go:64 +0x39
==================
--- FAIL: TestServerPoolWithPreNeg (0.19s)
    testing.go:1152: race detected during execution of test
==================
WARNING: DATA RACE
Write at 0x00c0002f8258 by goroutine 92:
  github.com/ethereum/go-ethereum/les/vflux/client.(*ServerPoolTest).start()
      /Users/piersy/projects/go-ethereum/les/vflux/client/serverpool_test.go:158 +0x717
  github.com/ethereum/go-ethereum/les/vflux/client.testServerPoolRestartNoDiscovery()
      /Users/piersy/projects/go-ethereum/les/vflux/client/serverpool_test.go:336 +0x109
  github.com/ethereum/go-ethereum/les/vflux/client.TestServerPoolRestartNoDiscovery()
      /Users/piersy/projects/go-ethereum/les/vflux/client/serverpool_test.go:323 +0x30
  testing.tRunner()
      /usr/local/go/src/testing/testing.go:1259 +0x22f
  testing.(*T).Run·dwrap·21()
      /usr/local/go/src/testing/testing.go:1306 +0x47

Previous read at 0x00c0002f8258 by goroutine 84:
  github.com/ethereum/go-ethereum/les/vflux/client.(*ServerPoolTest).start.func3()
      /Users/piersy/projects/go-ethereum/les/vflux/client/serverpool_test.go:170 +0x77

Goroutine 92 (running) created at:
  testing.(*T).Run()
      /usr/local/go/src/testing/testing.go:1306 +0x726
  testing.runTests.func1()
      /usr/local/go/src/testing/testing.go:1598 +0x99
  testing.tRunner()
      /usr/local/go/src/testing/testing.go:1259 +0x22f
  testing.runTests()
      /usr/local/go/src/testing/testing.go:1596 +0x7ca
  testing.(*M).Run()
      /usr/local/go/src/testing/testing.go:1504 +0x9d1
  main.main()
      _testmain.go:87 +0x22b

Goroutine 84 (finished) created at:
  github.com/ethereum/go-ethereum/les/vflux/client.(*ServerPoolTest).start()
      /Users/piersy/projects/go-ethereum/les/vflux/client/serverpool_test.go:159 +0x7cb
  github.com/ethereum/go-ethereum/les/vflux/client.testServerPoolRestartNoDiscovery()
      /Users/piersy/projects/go-ethereum/les/vflux/client/serverpool_test.go:331 +0x8e
  github.com/ethereum/go-ethereum/les/vflux/client.TestServerPoolRestartNoDiscovery()
      /Users/piersy/projects/go-ethereum/les/vflux/client/serverpool_test.go:323 +0x30
  testing.tRunner()
      /usr/local/go/src/testing/testing.go:1259 +0x22f
  testing.(*T).Run·dwrap·21()
      /usr/local/go/src/testing/testing.go:1306 +0x47
==================
--- FAIL: TestServerPoolRestartNoDiscovery (0.18s)
    testing.go:1152: race detected during execution of test
==================
WARNING: DATA RACE
Write at 0x00c0002f8390 by goroutine 18:
  github.com/ethereum/go-ethereum/les/vflux/client.(*ServerPoolTest).run()
      /Users/piersy/projects/go-ethereum/les/vflux/client/serverpool_test.go:237 +0x108
  github.com/ethereum/go-ethereum/les/vflux/client.testServerPoolRestartNoDiscovery()
      /Users/piersy/projects/go-ethereum/les/vflux/client/serverpool_test.go:332 +0x98
  github.com/ethereum/go-ethereum/les/vflux/client.TestServerPoolRestartNoDiscoveryWithPreNeg()
      /Users/piersy/projects/go-ethereum/les/vflux/client/serverpool_test.go:325 +0x33
  testing.tRunner()
      /usr/local/go/src/testing/testing.go:1259 +0x22f
  testing.(*T).Run·dwrap·21()
      /usr/local/go/src/testing/testing.go:1306 +0x47

Previous read at 0x00c0002f8390 by goroutine 88:
  github.com/ethereum/go-ethereum/les/vflux/client.(*ServerPoolTest).start.func1()
      /Users/piersy/projects/go-ethereum/les/vflux/client/serverpool_test.go:115 +0x152
  github.com/ethereum/go-ethereum/les/vflux/client.(*ServerPool).addPreNegFilter.func1.1()
      /Users/piersy/projects/go-ethereum/les/vflux/client/serverpool.go:275 +0x65

Goroutine 18 (running) created at:
  testing.(*T).Run()
      /usr/local/go/src/testing/testing.go:1306 +0x726
  testing.runTests.func1()
      /usr/local/go/src/testing/testing.go:1598 +0x99
  testing.tRunner()
      /usr/local/go/src/testing/testing.go:1259 +0x22f
  testing.runTests()
      /usr/local/go/src/testing/testing.go:1596 +0x7ca
  testing.(*M).Run()
      /usr/local/go/src/testing/testing.go:1504 +0x9d1
  main.main()
      _testmain.go:87 +0x22b

Goroutine 88 (running) created at:
  github.com/ethereum/go-ethereum/les/vflux/client.(*ServerPool).addPreNegFilter.func1()
      /Users/piersy/projects/go-ethereum/les/vflux/client/serverpool.go:274 +0x293
  github.com/ethereum/go-ethereum/p2p/nodestate.(*NodeStateMachine).setState.func1()
      /Users/piersy/projects/go-ethereum/p2p/nodestate/nodestate.go:687 +0x165
  github.com/ethereum/go-ethereum/p2p/nodestate.(*NodeStateMachine).opFinish()
      /Users/piersy/projects/go-ethereum/p2p/nodestate/nodestate.go:722 +0x1e1
  github.com/ethereum/go-ethereum/p2p/nodestate.(*NodeStateMachine).SetState()
      /Users/piersy/projects/go-ethereum/p2p/nodestate/nodestate.go:633 +0x211
  github.com/ethereum/go-ethereum/les/vflux/client.(*FillSet).readLoop()
      /Users/piersy/projects/go-ethereum/les/vflux/client/fillset.go:81 +0x9e
  github.com/ethereum/go-ethereum/les/vflux/client.NewFillSet·dwrap·1()
      /Users/piersy/projects/go-ethereum/les/vflux/client/fillset.go:64 +0x39
==================
==================
WARNING: DATA RACE
Write at 0x00c0002f8318 by goroutine 18:
  github.com/ethereum/go-ethereum/les/vflux/client.(*ServerPoolTest).start()
      /Users/piersy/projects/go-ethereum/les/vflux/client/serverpool_test.go:158 +0x717
  github.com/ethereum/go-ethereum/les/vflux/client.testServerPoolRestartNoDiscovery()
      /Users/piersy/projects/go-ethereum/les/vflux/client/serverpool_test.go:336 +0x109
  github.com/ethereum/go-ethereum/les/vflux/client.TestServerPoolRestartNoDiscoveryWithPreNeg()
      /Users/piersy/projects/go-ethereum/les/vflux/client/serverpool_test.go:325 +0x33
  testing.tRunner()
      /usr/local/go/src/testing/testing.go:1259 +0x22f
  testing.(*T).Run·dwrap·21()
      /usr/local/go/src/testing/testing.go:1306 +0x47

Previous read at 0x00c0002f8318 by goroutine 38:
  github.com/ethereum/go-ethereum/les/vflux/client.(*ServerPoolTest).start.func3()
      /Users/piersy/projects/go-ethereum/les/vflux/client/serverpool_test.go:170 +0x77

Goroutine 18 (running) created at:
  testing.(*T).Run()
      /usr/local/go/src/testing/testing.go:1306 +0x726
  testing.runTests.func1()
      /usr/local/go/src/testing/testing.go:1598 +0x99
  testing.tRunner()
      /usr/local/go/src/testing/testing.go:1259 +0x22f
  testing.runTests()
      /usr/local/go/src/testing/testing.go:1596 +0x7ca
  testing.(*M).Run()
      /usr/local/go/src/testing/testing.go:1504 +0x9d1
  main.main()
      _testmain.go:87 +0x22b

Goroutine 38 (finished) created at:
  github.com/ethereum/go-ethereum/les/vflux/client.(*ServerPoolTest).start()
      /Users/piersy/projects/go-ethereum/les/vflux/client/serverpool_test.go:159 +0x7cb
  github.com/ethereum/go-ethereum/les/vflux/client.testServerPoolRestartNoDiscovery()
      /Users/piersy/projects/go-ethereum/les/vflux/client/serverpool_test.go:331 +0x8e
  github.com/ethereum/go-ethereum/les/vflux/client.TestServerPoolRestartNoDiscoveryWithPreNeg()
      /Users/piersy/projects/go-ethereum/les/vflux/client/serverpool_test.go:325 +0x33
  testing.tRunner()
      /usr/local/go/src/testing/testing.go:1259 +0x22f
  testing.(*T).Run·dwrap·21()
      /usr/local/go/src/testing/testing.go:1306 +0x47
==================
--- FAIL: TestServerPoolRestartNoDiscoveryWithPreNeg (0.26s)
    testing.go:1152: race detected during execution of test
==================
WARNING: DATA RACE
Write at 0x00c0001424e0 by goroutine 75:
  github.com/ethereum/go-ethereum/les/vflux/client.(*referenceBasket).updateReqValues()
      /Users/piersy/projects/go-ethereum/les/vflux/client/requestbasket.go:178 +0x67
  github.com/ethereum/go-ethereum/les/vflux/client.(*referenceBasket).add()
      /Users/piersy/projects/go-ethereum/les/vflux/client/requestbasket.go:172 +0xdd
  github.com/ethereum/go-ethereum/les/vflux/client.(*ValueTracker).periodicUpdate()
      /Users/piersy/projects/go-ethereum/les/vflux/client/valuetracker.go:473 +0x27b
  github.com/ethereum/go-ethereum/les/vflux/client.NewValueTracker.func1()
      /Users/piersy/projects/go-ethereum/les/vflux/client/valuetracker.go:219 +0x75

Previous read at 0x00c0001424e0 by goroutine 57:
  github.com/ethereum/go-ethereum/les/vflux/client.(*NodeValueTracker).Served()
      /Users/piersy/projects/go-ethereum/les/vflux/client/valuetracker.go:115 +0x2c9
  github.com/ethereum/go-ethereum/les/vflux/client.TestValueTracker()
      /Users/piersy/projects/go-ethereum/les/vflux/client/valuetracker_test.go:80 +0x1405
  testing.tRunner()
      /usr/local/go/src/testing/testing.go:1259 +0x22f
  testing.(*T).Run·dwrap·21()
      /usr/local/go/src/testing/testing.go:1306 +0x47

Goroutine 75 (running) created at:
  github.com/ethereum/go-ethereum/les/vflux/client.NewValueTracker()
      /Users/piersy/projects/go-ethereum/les/vflux/client/valuetracker.go:214 +0x644
  github.com/ethereum/go-ethereum/les/vflux/client.TestValueTracker()
      /Users/piersy/projects/go-ethereum/les/vflux/client/valuetracker_test.go:60 +0x3a7
  testing.tRunner()
      /usr/local/go/src/testing/testing.go:1259 +0x22f
  testing.(*T).Run·dwrap·21()
      /usr/local/go/src/testing/testing.go:1306 +0x47

Goroutine 57 (running) created at:
  testing.(*T).Run()
      /usr/local/go/src/testing/testing.go:1306 +0x726
  testing.runTests.func1()
      /usr/local/go/src/testing/testing.go:1598 +0x99
  testing.tRunner()
      /usr/local/go/src/testing/testing.go:1259 +0x22f
  testing.runTests()
      /usr/local/go/src/testing/testing.go:1596 +0x7ca
  testing.(*M).Run()
      /usr/local/go/src/testing/testing.go:1504 +0x9d1
  main.main()
      _testmain.go:87 +0x22b
==================
==================
WARNING: DATA RACE
Read at 0x00c000446a18 by goroutine 57:
  github.com/ethereum/go-ethereum/les/vflux/client.(*NodeValueTracker).Served()
      /Users/piersy/projects/go-ethereum/les/vflux/client/valuetracker.go:115 +0x192
  github.com/ethereum/go-ethereum/les/vflux/client.TestValueTracker()
      /Users/piersy/projects/go-ethereum/les/vflux/client/valuetracker_test.go:80 +0x1405
  testing.tRunner()
      /usr/local/go/src/testing/testing.go:1259 +0x22f
  testing.(*T).Run·dwrap·21()
      /usr/local/go/src/testing/testing.go:1306 +0x47

Previous write at 0x00c000446a18 by goroutine 75:
  github.com/ethereum/go-ethereum/les/vflux/client.(*referenceBasket).updateReqValues()
      /Users/piersy/projects/go-ethereum/les/vflux/client/requestbasket.go:181 +0x1b3
  github.com/ethereum/go-ethereum/les/vflux/client.(*referenceBasket).add()
      /Users/piersy/projects/go-ethereum/les/vflux/client/requestbasket.go:172 +0xdd
  github.com/ethereum/go-ethereum/les/vflux/client.(*ValueTracker).periodicUpdate()
      /Users/piersy/projects/go-ethereum/les/vflux/client/valuetracker.go:473 +0x27b
  github.com/ethereum/go-ethereum/les/vflux/client.NewValueTracker.func1()
      /Users/piersy/projects/go-ethereum/les/vflux/client/valuetracker.go:219 +0x75

Goroutine 57 (running) created at:
  testing.(*T).Run()
      /usr/local/go/src/testing/testing.go:1306 +0x726
  testing.runTests.func1()
      /usr/local/go/src/testing/testing.go:1598 +0x99
  testing.tRunner()
      /usr/local/go/src/testing/testing.go:1259 +0x22f
  testing.runTests()
      /usr/local/go/src/testing/testing.go:1596 +0x7ca
  testing.(*M).Run()
      /usr/local/go/src/testing/testing.go:1504 +0x9d1
  main.main()
      _testmain.go:87 +0x22b

Goroutine 75 (running) created at:
  github.com/ethereum/go-ethereum/les/vflux/client.NewValueTracker()
      /Users/piersy/projects/go-ethereum/les/vflux/client/valuetracker.go:214 +0x644
  github.com/ethereum/go-ethereum/les/vflux/client.TestValueTracker()
      /Users/piersy/projects/go-ethereum/les/vflux/client/valuetracker_test.go:60 +0x3a7
  testing.tRunner()
      /usr/local/go/src/testing/testing.go:1259 +0x22f
  testing.(*T).Run·dwrap·21()
      /usr/local/go/src/testing/testing.go:1306 +0x47
==================
==================
WARNING: DATA RACE
Read at 0x00c000446c08 by goroutine 57:
  github.com/ethereum/go-ethereum/les/vflux/client.(*NodeValueTracker).Served()
      /Users/piersy/projects/go-ethereum/les/vflux/client/valuetracker.go:115 +0x192
  github.com/ethereum/go-ethereum/les/vflux/client.TestValueTracker()
      /Users/piersy/projects/go-ethereum/les/vflux/client/valuetracker_test.go:80 +0x1405
  testing.tRunner()
      /usr/local/go/src/testing/testing.go:1259 +0x22f
  testing.(*T).Run·dwrap·21()
      /usr/local/go/src/testing/testing.go:1306 +0x47

Previous write at 0x00c000446c08 by goroutine 75:
  github.com/ethereum/go-ethereum/les/vflux/client.(*referenceBasket).updateReqValues()
      /Users/piersy/projects/go-ethereum/les/vflux/client/requestbasket.go:181 +0x1b3
  github.com/ethereum/go-ethereum/les/vflux/client.(*ValueTracker).periodicUpdate()
      /Users/piersy/projects/go-ethereum/les/vflux/client/valuetracker.go:477 +0x2db
  github.com/ethereum/go-ethereum/les/vflux/client.NewValueTracker.func1()
      /Users/piersy/projects/go-ethereum/les/vflux/client/valuetracker.go:219 +0x75

Goroutine 57 (running) created at:
  testing.(*T).Run()
      /usr/local/go/src/testing/testing.go:1306 +0x726
  testing.runTests.func1()
      /usr/local/go/src/testing/testing.go:1598 +0x99
  testing.tRunner()
      /usr/local/go/src/testing/testing.go:1259 +0x22f
  testing.runTests()
      /usr/local/go/src/testing/testing.go:1596 +0x7ca
  testing.(*M).Run()
      /usr/local/go/src/testing/testing.go:1504 +0x9d1
  main.main()
      _testmain.go:87 +0x22b

Goroutine 75 (running) created at:
  github.com/ethereum/go-ethereum/les/vflux/client.NewValueTracker()
      /Users/piersy/projects/go-ethereum/les/vflux/client/valuetracker.go:214 +0x644
  github.com/ethereum/go-ethereum/les/vflux/client.TestValueTracker()
      /Users/piersy/projects/go-ethereum/les/vflux/client/valuetracker_test.go:60 +0x3a7
  testing.tRunner()
      /usr/local/go/src/testing/testing.go:1259 +0x22f
  testing.(*T).Run·dwrap·21()
      /usr/local/go/src/testing/testing.go:1306 +0x47
==================
--- FAIL: TestValueTracker (0.34s)
    testing.go:1152: race detected during execution of test
FAIL
FAIL	github.com/ethereum/go-ethereum/les/vflux/client	6.030s

p2p/discover

==================
WARNING: DATA RACE
Read at 0x00c000332600 by goroutine 56:
  github.com/ethereum/go-ethereum/p2p/discover.(*Table).nodeToRevalidate()
      /Users/piersy/projects/go-ethereum/p2p/discover/table.go:364 +0x1b7
  github.com/ethereum/go-ethereum/p2p/discover.(*Table).doRevalidate()
      /Users/piersy/projects/go-ethereum/p2p/discover/table.go:319 +0xaa
  github.com/ethereum/go-ethereum/p2p/discover.(*Table).loop·dwrap·12()
      /Users/piersy/projects/go-ethereum/p2p/discover/table.go:256 +0x47

Previous write at 0x00c000332600 by goroutine 9:
  github.com/ethereum/go-ethereum/p2p/discover.fillBucket()
      /Users/piersy/projects/go-ethereum/p2p/discover/table_util_test.go:104 +0x39e
  github.com/ethereum/go-ethereum/p2p/discover.testPingReplace()
      /Users/piersy/projects/go-ethereum/p2p/discover/table_test.go:62 +0x2ed
  github.com/ethereum/go-ethereum/p2p/discover.TestTable_pingReplace.func1.1()
      /Users/piersy/projects/go-ethereum/p2p/discover/table_test.go:41 +0x50
  testing.tRunner()
      /usr/local/go/src/testing/testing.go:1259 +0x22f
  testing.(*T).Run·dwrap·21()
      /usr/local/go/src/testing/testing.go:1306 +0x47

Goroutine 56 (running) created at:
  github.com/ethereum/go-ethereum/p2p/discover.(*Table).loop()
      /Users/piersy/projects/go-ethereum/p2p/discover/table.go:256 +0x9a8
  github.com/ethereum/go-ethereum/p2p/discover.newTestTable·dwrap·61()
      /Users/piersy/projects/go-ethereum/p2p/discover/table_util_test.go:47 +0x39

Goroutine 9 (running) created at:
  testing.(*T).Run()
      /usr/local/go/src/testing/testing.go:1306 +0x726
  github.com/ethereum/go-ethereum/p2p/discover.TestTable_pingReplace.func1()
      /Users/piersy/projects/go-ethereum/p2p/discover/table_test.go:39 +0x106
  github.com/ethereum/go-ethereum/p2p/discover.TestTable_pingReplace()
      /Users/piersy/projects/go-ethereum/p2p/discover/table_test.go:46 +0x68
  testing.tRunner()
      /usr/local/go/src/testing/testing.go:1259 +0x22f
  testing.(*T).Run·dwrap·21()
      /usr/local/go/src/testing/testing.go:1306 +0x47
==================
==================
WARNING: DATA RACE
Read at 0x00c0001a0378 by goroutine 56:
  github.com/ethereum/go-ethereum/p2p/discover.(*Table).nodeToRevalidate()
      /Users/piersy/projects/go-ethereum/p2p/discover/table.go:365 +0x21d
  github.com/ethereum/go-ethereum/p2p/discover.(*Table).doRevalidate()
      /Users/piersy/projects/go-ethereum/p2p/discover/table.go:319 +0xaa
  github.com/ethereum/go-ethereum/p2p/discover.(*Table).loop·dwrap·12()
      /Users/piersy/projects/go-ethereum/p2p/discover/table.go:256 +0x47

Previous write at 0x00c0001a0378 by goroutine 9:
  github.com/ethereum/go-ethereum/p2p/discover.fillBucket()
      /Users/piersy/projects/go-ethereum/p2p/discover/table_util_test.go:104 +0x358
  github.com/ethereum/go-ethereum/p2p/discover.testPingReplace()
      /Users/piersy/projects/go-ethereum/p2p/discover/table_test.go:62 +0x2ed
  github.com/ethereum/go-ethereum/p2p/discover.TestTable_pingReplace.func1.1()
      /Users/piersy/projects/go-ethereum/p2p/discover/table_test.go:41 +0x50
  testing.tRunner()
      /usr/local/go/src/testing/testing.go:1259 +0x22f
  testing.(*T).Run·dwrap·21()
      /usr/local/go/src/testing/testing.go:1306 +0x47

Goroutine 56 (running) created at:
  github.com/ethereum/go-ethereum/p2p/discover.(*Table).loop()
      /Users/piersy/projects/go-ethereum/p2p/discover/table.go:256 +0x9a8
  github.com/ethereum/go-ethereum/p2p/discover.newTestTable·dwrap·61()
      /Users/piersy/projects/go-ethereum/p2p/discover/table_util_test.go:47 +0x39

Goroutine 9 (running) created at:
  testing.(*T).Run()
      /usr/local/go/src/testing/testing.go:1306 +0x726
  github.com/ethereum/go-ethereum/p2p/discover.TestTable_pingReplace.func1()
      /Users/piersy/projects/go-ethereum/p2p/discover/table_test.go:39 +0x106
  github.com/ethereum/go-ethereum/p2p/discover.TestTable_pingReplace()
      /Users/piersy/projects/go-ethereum/p2p/discover/table_test.go:46 +0x68
  testing.tRunner()
      /usr/local/go/src/testing/testing.go:1259 +0x22f
  testing.(*T).Run·dwrap·21()
      /usr/local/go/src/testing/testing.go:1306 +0x47
==================
==================
WARNING: DATA RACE
Read at 0x00c0001367a0 by goroutine 56:
  runtime.racereadrange()
      <autogenerated>:1 +0x1b
  github.com/ethereum/go-ethereum/p2p/discover.(*Table).doRevalidate()
      /Users/piersy/projects/go-ethereum/p2p/discover/table.go:326 +0x102
  github.com/ethereum/go-ethereum/p2p/discover.(*Table).loop·dwrap·12()
      /Users/piersy/projects/go-ethereum/p2p/discover/table.go:256 +0x47

Previous write at 0x00c0001367a0 by goroutine 9:
  github.com/ethereum/go-ethereum/p2p/discover.wrapNode()
      /Users/piersy/projects/go-ethereum/p2p/discover/node.go:68 +0x15b
  github.com/ethereum/go-ethereum/p2p/discover.nodeAtDistance()
      /Users/piersy/projects/go-ethereum/p2p/discover/table_util_test.go:55 +0x26
  github.com/ethereum/go-ethereum/p2p/discover.fillBucket()
      /Users/piersy/projects/go-ethereum/p2p/discover/table_util_test.go:104 +0x2dc
  github.com/ethereum/go-ethereum/p2p/discover.testPingReplace()
      /Users/piersy/projects/go-ethereum/p2p/discover/table_test.go:62 +0x2ed
  github.com/ethereum/go-ethereum/p2p/discover.TestTable_pingReplace.func1.1()
      /Users/piersy/projects/go-ethereum/p2p/discover/table_test.go:41 +0x50
  testing.tRunner()
      /usr/local/go/src/testing/testing.go:1259 +0x22f
  testing.(*T).Run·dwrap·21()
      /usr/local/go/src/testing/testing.go:1306 +0x47

Goroutine 56 (running) created at:
  github.com/ethereum/go-ethereum/p2p/discover.(*Table).loop()
      /Users/piersy/projects/go-ethereum/p2p/discover/table.go:256 +0x9a8
  github.com/ethereum/go-ethereum/p2p/discover.newTestTable·dwrap·61()
      /Users/piersy/projects/go-ethereum/p2p/discover/table_util_test.go:47 +0x39

Goroutine 9 (running) created at:
  testing.(*T).Run()
      /usr/local/go/src/testing/testing.go:1306 +0x726
  github.com/ethereum/go-ethereum/p2p/discover.TestTable_pingReplace.func1()
      /Users/piersy/projects/go-ethereum/p2p/discover/table_test.go:39 +0x106
  github.com/ethereum/go-ethereum/p2p/discover.TestTable_pingReplace()
      /Users/piersy/projects/go-ethereum/p2p/discover/table_test.go:46 +0x68
  testing.tRunner()
      /usr/local/go/src/testing/testing.go:1259 +0x22f
  testing.(*T).Run·dwrap·21()
      /usr/local/go/src/testing/testing.go:1306 +0x47
==================
==================
WARNING: DATA RACE
Read at 0x00c00007fdd0 by goroutine 56:
  runtime.mapaccess1()
      /usr/local/go/src/runtime/map.go:394 +0x0
  github.com/ethereum/go-ethereum/p2p/discover.(*pingRecorder).ping()
      /Users/piersy/projects/go-ethereum/p2p/discover/table_util_test.go:156 +0x1d5
  github.com/ethereum/go-ethereum/p2p/discover.(*Table).doRevalidate()
      /Users/piersy/projects/go-ethereum/p2p/discover/table.go:326 +0x102
  github.com/ethereum/go-ethereum/p2p/discover.(*Table).loop·dwrap·12()
      /Users/piersy/projects/go-ethereum/p2p/discover/table.go:256 +0x47

Previous write at 0x00c00007fdd0 by goroutine 9:
  runtime.mapassign()
      /usr/local/go/src/runtime/map.go:571 +0x0
  github.com/ethereum/go-ethereum/p2p/discover.testPingReplace()
      /Users/piersy/projects/go-ethereum/p2p/discover/table_test.go:66 +0x38b
  github.com/ethereum/go-ethereum/p2p/discover.TestTable_pingReplace.func1.1()
      /Users/piersy/projects/go-ethereum/p2p/discover/table_test.go:41 +0x50
  testing.tRunner()
      /usr/local/go/src/testing/testing.go:1259 +0x22f
  testing.(*T).Run·dwrap·21()
      /usr/local/go/src/testing/testing.go:1306 +0x47

Goroutine 56 (running) created at:
  github.com/ethereum/go-ethereum/p2p/discover.(*Table).loop()
      /Users/piersy/projects/go-ethereum/p2p/discover/table.go:256 +0x9a8
  github.com/ethereum/go-ethereum/p2p/discover.newTestTable·dwrap·61()
      /Users/piersy/projects/go-ethereum/p2p/discover/table_util_test.go:47 +0x39

Goroutine 9 (running) created at:
  testing.(*T).Run()
      /usr/local/go/src/testing/testing.go:1306 +0x726
  github.com/ethereum/go-ethereum/p2p/discover.TestTable_pingReplace.func1()
      /Users/piersy/projects/go-ethereum/p2p/discover/table_test.go:39 +0x106
  github.com/ethereum/go-ethereum/p2p/discover.TestTable_pingReplace()
      /Users/piersy/projects/go-ethereum/p2p/discover/table_test.go:46 +0x68
  testing.tRunner()
      /usr/local/go/src/testing/testing.go:1259 +0x22f
  testing.(*T).Run·dwrap·21()
      /usr/local/go/src/testing/testing.go:1306 +0x47
==================
==================
WARNING: DATA RACE
Read at 0x00c0002be108 by goroutine 56:
  github.com/ethereum/go-ethereum/p2p/discover.(*pingRecorder).ping()
      /Users/piersy/projects/go-ethereum/p2p/discover/table_util_test.go:156 +0x1e4
  github.com/ethereum/go-ethereum/p2p/discover.(*Table).doRevalidate()
      /Users/piersy/projects/go-ethereum/p2p/discover/table.go:326 +0x102
  github.com/ethereum/go-ethereum/p2p/discover.(*Table).loop·dwrap·12()
      /Users/piersy/projects/go-ethereum/p2p/discover/table.go:256 +0x47

Previous write at 0x00c0002be108 by goroutine 9:
  github.com/ethereum/go-ethereum/p2p/discover.testPingReplace()
      /Users/piersy/projects/go-ethereum/p2p/discover/table_test.go:66 +0x39a
  github.com/ethereum/go-ethereum/p2p/discover.TestTable_pingReplace.func1.1()
      /Users/piersy/projects/go-ethereum/p2p/discover/table_test.go:41 +0x50
  testing.tRunner()
      /usr/local/go/src/testing/testing.go:1259 +0x22f
  testing.(*T).Run·dwrap·21()
      /usr/local/go/src/testing/testing.go:1306 +0x47

Goroutine 56 (running) created at:
  github.com/ethereum/go-ethereum/p2p/discover.(*Table).loop()
      /Users/piersy/projects/go-ethereum/p2p/discover/table.go:256 +0x9a8
  github.com/ethereum/go-ethereum/p2p/discover.newTestTable·dwrap·61()
      /Users/piersy/projects/go-ethereum/p2p/discover/table_util_test.go:47 +0x39

Goroutine 9 (running) created at:
  testing.(*T).Run()
      /usr/local/go/src/testing/testing.go:1306 +0x726
  github.com/ethereum/go-ethereum/p2p/discover.TestTable_pingReplace.func1()
      /Users/piersy/projects/go-ethereum/p2p/discover/table_test.go:39 +0x106
  github.com/ethereum/go-ethereum/p2p/discover.TestTable_pingReplace()
      /Users/piersy/projects/go-ethereum/p2p/discover/table_test.go:46 +0x68
  testing.tRunner()
      /usr/local/go/src/testing/testing.go:1259 +0x22f
  testing.(*T).Run·dwrap·21()
      /usr/local/go/src/testing/testing.go:1306 +0x47
==================
==================
WARNING: DATA RACE
Read at 0x00c000136750 by goroutine 56:
  github.com/ethereum/go-ethereum/p2p/enr.(*Record).Seq()
      /Users/piersy/projects/go-ethereum/p2p/enr/enr.go:101 +0x11a
  github.com/ethereum/go-ethereum/p2p/enode.(*Node).Seq()
      /Users/piersy/projects/go-ethereum/p2p/enode/node.go:89 +0x10d
  github.com/ethereum/go-ethereum/p2p/discover.(*Table).doRevalidate()
      /Users/piersy/projects/go-ethereum/p2p/discover/table.go:329 +0x12b
  github.com/ethereum/go-ethereum/p2p/discover.(*Table).loop·dwrap·12()
      /Users/piersy/projects/go-ethereum/p2p/discover/table.go:256 +0x47

Previous write at 0x00c000136750 by goroutine 9:
  github.com/ethereum/go-ethereum/p2p/discover.wrapNode()
      /Users/piersy/projects/go-ethereum/p2p/discover/node.go:68 +0x15b
  github.com/ethereum/go-ethereum/p2p/discover.nodeAtDistance()
      /Users/piersy/projects/go-ethereum/p2p/discover/table_util_test.go:55 +0x26
  github.com/ethereum/go-ethereum/p2p/discover.fillBucket()
      /Users/piersy/projects/go-ethereum/p2p/discover/table_util_test.go:104 +0x2dc
  github.com/ethereum/go-ethereum/p2p/discover.testPingReplace()
      /Users/piersy/projects/go-ethereum/p2p/discover/table_test.go:62 +0x2ed
  github.com/ethereum/go-ethereum/p2p/discover.TestTable_pingReplace.func1.1()
      /Users/piersy/projects/go-ethereum/p2p/discover/table_test.go:41 +0x50
  testing.tRunner()
      /usr/local/go/src/testing/testing.go:1259 +0x22f
  testing.(*T).Run·dwrap·21()
      /usr/local/go/src/testing/testing.go:1306 +0x47

Goroutine 56 (running) created at:
  github.com/ethereum/go-ethereum/p2p/discover.(*Table).loop()
      /Users/piersy/projects/go-ethereum/p2p/discover/table.go:256 +0x9a8
  github.com/ethereum/go-ethereum/p2p/discover.newTestTable·dwrap·61()
      /Users/piersy/projects/go-ethereum/p2p/discover/table_util_test.go:47 +0x39

Goroutine 9 (running) created at:
  testing.(*T).Run()
      /usr/local/go/src/testing/testing.go:1306 +0x726
  github.com/ethereum/go-ethereum/p2p/discover.TestTable_pingReplace.func1()
      /Users/piersy/projects/go-ethereum/p2p/discover/table_test.go:39 +0x106
  github.com/ethereum/go-ethereum/p2p/discover.TestTable_pingReplace()
      /Users/piersy/projects/go-ethereum/p2p/discover/table_test.go:46 +0x68
  testing.tRunner()
      /usr/local/go/src/testing/testing.go:1259 +0x22f
  testing.(*T).Run·dwrap·21()
      /usr/local/go/src/testing/testing.go:1306 +0x47
==================
--- FAIL: TestTable_pingReplace (0.00s)
    --- FAIL: TestTable_pingReplace/newNodeResponding=false/lastInBucketResponding=false (0.01s)
        testing.go:1152: race detected during execution of test
    --- FAIL: TestTable_pingReplace/newNodeResponding=true/lastInBucketResponding=false (0.01s)
        testing.go:1152: race detected during execution of test
    --- FAIL: TestTable_pingReplace/newNodeResponding=false/lastInBucketResponding=true (0.01s)
        testing.go:1152: race detected during execution of test
    --- FAIL: TestTable_pingReplace/newNodeResponding=true/lastInBucketResponding=true (0.01s)
        testing.go:1152: race detected during execution of test
FAIL
FAIL	github.com/ethereum/go-ethereum/p2p/discover	70.881s

Steps to reproduce the behaviour

go test -p 1 -race ./...
@holiman
Copy link
Contributor

holiman commented Nov 9, 2021

Thanks for reporting, this was fixed by #23865

@holiman holiman closed this as completed Nov 9, 2021
@holiman
Copy link
Contributor

holiman commented Nov 9, 2021

Actually, it wasn't though. Or maybe this is a new one

[user@work client]$ go test . -race --count 5
==================
WARNING: DATA RACE
Write at 0x00c00060a8c0 by goroutine 81:
  github.com/ethereum/go-ethereum/les/vflux/client.(*ServerPoolTest).resetNodes()
      /home/user/go/src/github.com/ethereum/go-ethereum/les/vflux/client/serverpool_test.go:276 +0x297
  github.com/ethereum/go-ethereum/les/vflux/client.testServerPoolChangedNodes()
      /home/user/go/src/github.com/ethereum/go-ethereum/les/vflux/client/serverpool_test.go:324 +0xcc
  github.com/ethereum/go-ethereum/les/vflux/client.TestServerPoolChangedNodesWithPreNeg()
      /home/user/go/src/github.com/ethereum/go-ethereum/les/vflux/client/serverpool_test.go:315 +0x33
  testing.tRunner()
      /usr/local/go/src/testing/testing.go:1259 +0x22f
  testing.(*T).Run·dwrap·21()
      /usr/local/go/src/testing/testing.go:1306 +0x47

Previous read at 0x00c00060a8c0 by goroutine 11:
  github.com/ethereum/go-ethereum/les/vflux/client.(*ServerPoolTest).start.func1()
      /home/user/go/src/github.com/ethereum/go-ethereum/les/vflux/client/serverpool_test.go:119 +0x150
  github.com/ethereum/go-ethereum/les/vflux/client.(*ServerPool).addPreNegFilter.func1.1()
      /home/user/go/src/github.com/ethereum/go-ethereum/les/vflux/client/serverpool.go:275 +0x65

Goroutine 81 (running) created at:
  testing.(*T).Run()
      /usr/local/go/src/testing/testing.go:1306 +0x726
  testing.runTests.func1()
      /usr/local/go/src/testing/testing.go:1598 +0x99
  testing.tRunner()
      /usr/local/go/src/testing/testing.go:1259 +0x22f
  testing.runTests()
      /usr/local/go/src/testing/testing.go:1596 +0x7ca
  testing.(*M).Run()
      /usr/local/go/src/testing/testing.go:1504 +0x9d1
  main.main()
      _testmain.go:87 +0x22b

Goroutine 11 (running) created at:
  github.com/ethereum/go-ethereum/les/vflux/client.(*ServerPool).addPreNegFilter.func1()
      /home/user/go/src/github.com/ethereum/go-ethereum/les/vflux/client/serverpool.go:274 +0x293
  github.com/ethereum/go-ethereum/p2p/nodestate.(*NodeStateMachine).setState.func1()
      /home/user/go/src/github.com/ethereum/go-ethereum/p2p/nodestate/nodestate.go:687 +0x165
  github.com/ethereum/go-ethereum/p2p/nodestate.(*NodeStateMachine).opFinish()
      /home/user/go/src/github.com/ethereum/go-ethereum/p2p/nodestate/nodestate.go:722 +0x1e1
  github.com/ethereum/go-ethereum/p2p/nodestate.(*NodeStateMachine).SetState()
      /home/user/go/src/github.com/ethereum/go-ethereum/p2p/nodestate/nodestate.go:633 +0x211
  github.com/ethereum/go-ethereum/les/vflux/client.(*FillSet).readLoop()
      /home/user/go/src/github.com/ethereum/go-ethereum/les/vflux/client/fillset.go:81 +0x9e
  github.com/ethereum/go-ethereum/les/vflux/client.NewFillSet·dwrap·1()
      /home/user/go/src/github.com/ethereum/go-ethereum/les/vflux/client/fillset.go:64 +0x39
==================
==================
WARNING: DATA RACE
Write at 0x00c00060a8d0 by goroutine 81:
  github.com/ethereum/go-ethereum/les/vflux/client.(*ServerPoolTest).resetNodes()
      /home/user/go/src/github.com/ethereum/go-ethereum/les/vflux/client/serverpool_test.go:276 +0x297
  github.com/ethereum/go-ethereum/les/vflux/client.testServerPoolChangedNodes()
      /home/user/go/src/github.com/ethereum/go-ethereum/les/vflux/client/serverpool_test.go:324 +0xcc
  github.com/ethereum/go-ethereum/les/vflux/client.TestServerPoolChangedNodesWithPreNeg()
      /home/user/go/src/github.com/ethereum/go-ethereum/les/vflux/client/serverpool_test.go:315 +0x33
  testing.tRunner()
      /usr/local/go/src/testing/testing.go:1259 +0x22f
  testing.(*T).Run·dwrap·21()
      /usr/local/go/src/testing/testing.go:1306 +0x47

Previous read at 0x00c00060a8d0 by goroutine 11:
  github.com/ethereum/go-ethereum/les/vflux/client.(*ServerPoolTest).start.func1()
      /home/user/go/src/github.com/ethereum/go-ethereum/les/vflux/client/serverpool_test.go:119 +0x1a6
  github.com/ethereum/go-ethereum/les/vflux/client.(*ServerPool).addPreNegFilter.func1.1()
      /home/user/go/src/github.com/ethereum/go-ethereum/les/vflux/client/serverpool.go:275 +0x65

Goroutine 81 (running) created at:
  testing.(*T).Run()
      /usr/local/go/src/testing/testing.go:1306 +0x726
  testing.runTests.func1()
      /usr/local/go/src/testing/testing.go:1598 +0x99
  testing.tRunner()
      /usr/local/go/src/testing/testing.go:1259 +0x22f
  testing.runTests()
      /usr/local/go/src/testing/testing.go:1596 +0x7ca
  testing.(*M).Run()
      /usr/local/go/src/testing/testing.go:1504 +0x9d1
  main.main()
      _testmain.go:87 +0x22b

Goroutine 11 (running) created at:
  github.com/ethereum/go-ethereum/les/vflux/client.(*ServerPool).addPreNegFilter.func1()
      /home/user/go/src/github.com/ethereum/go-ethereum/les/vflux/client/serverpool.go:274 +0x293
  github.com/ethereum/go-ethereum/p2p/nodestate.(*NodeStateMachine).setState.func1()
      /home/user/go/src/github.com/ethereum/go-ethereum/p2p/nodestate/nodestate.go:687 +0x165
  github.com/ethereum/go-ethereum/p2p/nodestate.(*NodeStateMachine).opFinish()
      /home/user/go/src/github.com/ethereum/go-ethereum/p2p/nodestate/nodestate.go:722 +0x1e1
  github.com/ethereum/go-ethereum/p2p/nodestate.(*NodeStateMachine).SetState()
      /home/user/go/src/github.com/ethereum/go-ethereum/p2p/nodestate/nodestate.go:633 +0x211
  github.com/ethereum/go-ethereum/les/vflux/client.(*FillSet).readLoop()
      /home/user/go/src/github.com/ethereum/go-ethereum/les/vflux/client/fillset.go:81 +0x9e
  github.com/ethereum/go-ethereum/les/vflux/client.NewFillSet·dwrap·1()
      /home/user/go/src/github.com/ethereum/go-ethereum/les/vflux/client/fillset.go:64 +0x39
==================
--- FAIL: TestServerPoolChangedNodesWithPreNeg (1.88s)
    testing.go:1152: race detected during execution of test
==================
WARNING: DATA RACE
Read at 0x00c00053f510 by goroutine 72:
  github.com/ethereum/go-ethereum/les/vflux/client.(*ServerPoolTest).start.func1()
      /home/user/go/src/github.com/ethereum/go-ethereum/les/vflux/client/serverpool_test.go:119 +0x12b
  github.com/ethereum/go-ethereum/les/vflux/client.(*ServerPool).addPreNegFilter.func1.1()
      /home/user/go/src/github.com/ethereum/go-ethereum/les/vflux/client/serverpool.go:275 +0x65

Previous write at 0x00c00053f510 by goroutine 52:
  [failed to restore the stack]

Goroutine 72 (running) created at:
  github.com/ethereum/go-ethereum/les/vflux/client.(*ServerPool).addPreNegFilter.func1()
      /home/user/go/src/github.com/ethereum/go-ethereum/les/vflux/client/serverpool.go:274 +0x293
  github.com/ethereum/go-ethereum/p2p/nodestate.(*NodeStateMachine).setState.func1()
      /home/user/go/src/github.com/ethereum/go-ethereum/p2p/nodestate/nodestate.go:687 +0x165
  github.com/ethereum/go-ethereum/p2p/nodestate.(*NodeStateMachine).opFinish()
      /home/user/go/src/github.com/ethereum/go-ethereum/p2p/nodestate/nodestate.go:722 +0x1e1
  github.com/ethereum/go-ethereum/p2p/nodestate.(*NodeStateMachine).SetState()
      /home/user/go/src/github.com/ethereum/go-ethereum/p2p/nodestate/nodestate.go:633 +0x211
  github.com/ethereum/go-ethereum/les/vflux/client.(*FillSet).readLoop()
      /home/user/go/src/github.com/ethereum/go-ethereum/les/vflux/client/fillset.go:81 +0x9e
  github.com/ethereum/go-ethereum/les/vflux/client.NewFillSet·dwrap·1()
      /home/user/go/src/github.com/ethereum/go-ethereum/les/vflux/client/fillset.go:64 +0x39

Goroutine 52 (running) created at:
  testing.(*T).Run()
      /usr/local/go/src/testing/testing.go:1306 +0x726
  testing.runTests.func1()
      /usr/local/go/src/testing/testing.go:1598 +0x99
  testing.tRunner()
      /usr/local/go/src/testing/testing.go:1259 +0x22f
  testing.runTests()
      /usr/local/go/src/testing/testing.go:1596 +0x7ca
  testing.(*M).Run()
      /usr/local/go/src/testing/testing.go:1504 +0x9d1
  main.main()
      _testmain.go:87 +0x22b
==================
==================
WARNING: DATA RACE
Read at 0x00c00053f500 by goroutine 72:
  github.com/ethereum/go-ethereum/les/vflux/client.(*ServerPoolTest).start.func1()
      /home/user/go/src/github.com/ethereum/go-ethereum/les/vflux/client/serverpool_test.go:119 +0x1a6
  github.com/ethereum/go-ethereum/les/vflux/client.(*ServerPool).addPreNegFilter.func1.1()
      /home/user/go/src/github.com/ethereum/go-ethereum/les/vflux/client/serverpool.go:275 +0x65

Previous write at 0x00c00053f500 by goroutine 52:
  [failed to restore the stack]

Goroutine 72 (running) created at:
  github.com/ethereum/go-ethereum/les/vflux/client.(*ServerPool).addPreNegFilter.func1()
      /home/user/go/src/github.com/ethereum/go-ethereum/les/vflux/client/serverpool.go:274 +0x293
  github.com/ethereum/go-ethereum/p2p/nodestate.(*NodeStateMachine).setState.func1()
      /home/user/go/src/github.com/ethereum/go-ethereum/p2p/nodestate/nodestate.go:687 +0x165
  github.com/ethereum/go-ethereum/p2p/nodestate.(*NodeStateMachine).opFinish()
      /home/user/go/src/github.com/ethereum/go-ethereum/p2p/nodestate/nodestate.go:722 +0x1e1
  github.com/ethereum/go-ethereum/p2p/nodestate.(*NodeStateMachine).SetState()
      /home/user/go/src/github.com/ethereum/go-ethereum/p2p/nodestate/nodestate.go:633 +0x211
  github.com/ethereum/go-ethereum/les/vflux/client.(*FillSet).readLoop()
      /home/user/go/src/github.com/ethereum/go-ethereum/les/vflux/client/fillset.go:81 +0x9e
  github.com/ethereum/go-ethereum/les/vflux/client.NewFillSet·dwrap·1()
      /home/user/go/src/github.com/ethereum/go-ethereum/les/vflux/client/fillset.go:64 +0x39

Goroutine 52 (running) created at:
  testing.(*T).Run()
      /usr/local/go/src/testing/testing.go:1306 +0x726
  testing.runTests.func1()
      /usr/local/go/src/testing/testing.go:1598 +0x99
  testing.tRunner()
      /usr/local/go/src/testing/testing.go:1259 +0x22f
  testing.runTests()
      /usr/local/go/src/testing/testing.go:1596 +0x7ca
  testing.(*M).Run()
      /usr/local/go/src/testing/testing.go:1504 +0x9d1
  main.main()
      _testmain.go:87 +0x22b
==================
--- FAIL: TestServerPoolRestartNoDiscoveryWithPreNeg (0.39s)
    testing.go:1152: race detected during execution of test
FAIL
FAIL    github.com/ethereum/go-ethereum/les/vflux/client        39.898s
FAIL

@holiman holiman reopened this Nov 9, 2021
@piersy
Copy link
Contributor Author

piersy commented Nov 26, 2021

@holiman Just noting that whether races occur is not deterministic, so a clean run does not imply that all races are fixed.

When tackling such problems I generally run tests 10,100,1000,10000 times as much as time permits to see if the races have been fixed (you never really know for sure).

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 a pull request may close this issue.

4 participants