diff --git a/p2p/pex/pex_reactor_test.go b/p2p/pex/pex_reactor_test.go index a32164628..768725b91 100644 --- a/p2p/pex/pex_reactor_test.go +++ b/p2p/pex/pex_reactor_test.go @@ -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