Browse Source

test: fix TestPEXReactorRunning data race (#5955)

Fixes #5941.

Not entirely sure that this will fix the problem (couldn't reproduce), but in any case this is an artifact of a hack in the P2P transport refactor to make it work with the legacy P2P stack, and will be removed when the refactor is done anyway.
pull/5961/head
Erik Grinaker 3 years ago
committed by GitHub
parent
commit
9c98af4277
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 5 deletions
  1. +5
    -5
      p2p/pex/pex_reactor_test.go

+ 5
- 5
p2p/pex/pex_reactor_test.go View File

@ -94,6 +94,11 @@ func TestPEXReactorRunning(t *testing.T) {
})
}
for _, sw := range switches {
err := sw.Start() // start switch and reactors
require.Nil(t, err)
}
addOtherNodeAddrToAddrBook := func(switchIndex, otherSwitchIndex int) {
addr := switches[otherSwitchIndex].NetAddress()
err := books[switchIndex].AddAddress(addr, addr)
@ -104,11 +109,6 @@ func TestPEXReactorRunning(t *testing.T) {
addOtherNodeAddrToAddrBook(1, 0)
addOtherNodeAddrToAddrBook(2, 1)
for _, sw := range switches {
err := sw.Start() // start switch and reactors
require.Nil(t, err)
}
assertPeersWithTimeout(t, switches, 10*time.Millisecond, 10*time.Second, N-1)
// stop them


Loading…
Cancel
Save