Skip to content
This repository was archived by the owner on Aug 2, 2021. It is now read-only.

Data race in swarm/network/simulation tests #1110

Closed
frncmx opened this issue Jan 14, 2019 · 0 comments · Fixed by ethereum/go-ethereum#18464
Closed

Data race in swarm/network/simulation tests #1110

frncmx opened this issue Jan 14, 2019 · 0 comments · Fixed by ethereum/go-ethereum#18464
Assignees

Comments

@frncmx
Copy link
Contributor

frncmx commented Jan 14, 2019

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
==================
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants