Browse Source

fix: make p2p evidence_pending test not timing dependent (#6252)

pull/6253/head
Sam Kleinman 4 years ago
committed by GitHub
parent
commit
5c547137f6
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 14 deletions
  1. +1
    -14
      evidence/reactor_test.go

+ 1
- 14
evidence/reactor_test.go View File

@ -382,23 +382,10 @@ func TestReactorBroadcastEvidence_Pending(t *testing.T) {
require.NoError(t, rts.pools[secondary.NodeID].AddEvidence(evList[i]))
}
rts.start(t)
// the secondary should have half the evidence as pending
require.Equal(t, numEvidence/2, int(rts.pools[secondary.NodeID].Size()))
// adding the secondary node back in node back in
require.NoError(t, primary.PeerManager.Add(secondary.NodeAddress))
startAt := time.Now()
for {
if time.Since(startAt) > time.Second {
require.Fail(t, "could not reconnect the secondary in less than a second")
}
if primary.PeerManager.Status(secondary.NodeID) == p2p.PeerStatusUp {
break
}
}
rts.start(t)
// The secondary reactor should have received all the evidence ignoring the
// already pending evidence.


Loading…
Cancel
Save