cs.Wait()

This commit is contained in:
Ethan Buchman
2017-01-12 14:44:42 -05:00
parent 0525e8ed5c
commit e7a12f8e38
4 changed files with 34 additions and 7 deletions

View File

@@ -118,7 +118,16 @@ func runReplayTest(t *testing.T, cs *ConsensusState, walDir string, newBlockCh c
// Assuming the consensus state is running, replay of any WAL, including the empty one,
// should eventually be followed by a new block, or else something is wrong
waitForBlock(newBlockCh, thisCase, i)
cs.evsw.Stop()
cs.Stop()
LOOP:
for {
select {
case <-newBlockCh:
default:
break LOOP
}
}
cs.Wait()
}