From 55bae62d71d9194c248de0654a63802186b4c0a5 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Tue, 5 Jun 2018 16:54:58 -0700 Subject: [PATCH] fix test --- evidence/reactor_test.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/evidence/reactor_test.go b/evidence/reactor_test.go index c7034c321..2f1c34e6e 100644 --- a/evidence/reactor_test.go +++ b/evidence/reactor_test.go @@ -84,7 +84,7 @@ func _waitForEvidence(t *testing.T, wg *sync.WaitGroup, evs types.EvidenceList, } reapedEv := evpool.PendingEvidence() - // put the reaped evidence is a map so we can quickly check we got everything + // put the reaped evidence in a map so we can quickly check we got everything evMap := make(map[string]types.Evidence) for _, e := range reapedEv { evMap[string(e.Hash())] = e @@ -95,6 +95,7 @@ func _waitForEvidence(t *testing.T, wg *sync.WaitGroup, evs types.EvidenceList, fmt.Sprintf("evidence at index %d on reactor %d don't match: %v vs %v", i, reactorIdx, expectedEv, gotEv)) } + wg.Done() } @@ -110,7 +111,7 @@ func sendEvidence(t *testing.T, evpool *EvidencePool, valAddr []byte, n int) typ } var ( - NUM_EVIDENCE = 1 + NUM_EVIDENCE = 10 TIMEOUT = 120 * time.Second // ridiculously high because CircleCI is slow ) @@ -174,4 +175,8 @@ func TestReactorSelectiveBroadcast(t *testing.T) { // only ones less than the peers height should make it through waitForEvidence(t, evList[:NUM_EVIDENCE/2], reactors[1:2]) + + // peers should still be connected + peers := reactors[1].Switch.Peers().List() + assert.Equal(t, 1, len(peers)) }