This repository was archived by the owner on Aug 2, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 110
This repository was archived by the owner on Aug 2, 2021. It is now read-only.
Data race in swarm/network/simulation tests #1110
Copy link
Copy link
Closed
ethereum/go-ethereum
#18464Description
How to reproduce?
go test -race -count 1 -run TestServiceBucket github.com/ethereum/go-ethereum/swarm/network/simulation
Also failing:
--- FAIL: TestUpDownNodeIDs (0.18s)
--- FAIL: TestStartStopNode (1.02s)
--- FAIL: TestStartStopRandomNode (1.06s)
--- FAIL: TestStartStopRandomNodes (1.21s)
Stacktrace
==================
WARNING: DATA RACE
Read at 0x00c0002a06f8 by goroutine 16:
github.com/ethereum/go-ethereum/p2p/simulations.NewEvent()
/home/frncmx/code/src/github.com/ethereum/go-ethereum/p2p/simulations/events.go:76 +0x4b1
github.com/ethereum/go-ethereum/p2p/simulations.ControlEvent()
/home/frncmx/code/src/github.com/ethereum/go-ethereum/p2p/simulations/events.go:94 +0x42
github.com/ethereum/go-ethereum/p2p/simulations.(*Network).Stop()
/home/frncmx/code/src/github.com/ethereum/go-ethereum/p2p/simulations/network.go:273 +0x2f5
github.com/ethereum/go-ethereum/swarm/network/simulation.(*Simulation).StopNode()
/home/frncmx/code/src/github.com/ethereum/go-ethereum/swarm/network/simulation/node.go:277 +0x7d
github.com/ethereum/go-ethereum/swarm/network/simulation.TestServiceBucket()
/home/frncmx/code/src/github.com/ethereum/go-ethereum/swarm/network/simulation/bucket_test.go:103 +0x6a7
testing.tRunner()
/usr/lib/go/src/testing/testing.go:827 +0x162
Previous write at 0x00c0002a06f8 by goroutine 57:
github.com/ethereum/go-ethereum/p2p/simulations.(*Network).watchPeerEvents.func1()
/home/frncmx/code/src/github.com/ethereum/go-ethereum/p2p/simulations/network.go:217 +0x16d
github.com/ethereum/go-ethereum/p2p/simulations.(*Network).watchPeerEvents()
/home/frncmx/code/src/github.com/ethereum/go-ethereum/p2p/simulations/network.go:247 +0x7f1
Goroutine 16 (running) created at:
testing.(*T).Run()
/usr/lib/go/src/testing/testing.go:878 +0x659
testing.runTests.func1()
/usr/lib/go/src/testing/testing.go:1119 +0xa8
testing.tRunner()
/usr/lib/go/src/testing/testing.go:827 +0x162
testing.runTests()
/usr/lib/go/src/testing/testing.go:1117 +0x4ee
testing.(*M).Run()
/usr/lib/go/src/testing/testing.go:1034 +0x2ee
main.main()
_testmain.go:90 +0x221
Goroutine 57 (finished) created at:
github.com/ethereum/go-ethereum/p2p/simulations.(*Network).startWithSnapshots()
/home/frncmx/code/src/github.com/ethereum/go-ethereum/p2p/simulations/network.go:200 +0xa27
github.com/ethereum/go-ethereum/p2p/simulations.(*Network).Start()
/home/frncmx/code/src/github.com/ethereum/go-ethereum/p2p/simulations/network.go:164 +0x76
github.com/ethereum/go-ethereum/swarm/network/simulation.(*Simulation).AddNode()
/home/frncmx/code/src/github.com/ethereum/go-ethereum/swarm/network/simulation/node.go:103 +0x2a0
github.com/ethereum/go-ethereum/swarm/network/simulation.TestServiceBucket()
/home/frncmx/code/src/github.com/ethereum/go-ethereum/swarm/network/simulation/bucket_test.go:48 +0x2da
testing.tRunner()
/usr/lib/go/src/testing/testing.go:827 +0x162
==================