Merge pull request #836 from tendermint/fix/tests

consensus: make mempool_test deterministic
This commit is contained in:
Ethan Buchman 2017-11-10 05:08:54 +00:00 committed by GitHub
commit 847f865438
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 3 deletions

View File

@ -26,11 +26,10 @@ func TestNoProgressUntilTxsAvailable(t *testing.T) {
ensureNewStep(newBlockCh) // first block gets committed ensureNewStep(newBlockCh) // first block gets committed
ensureNoNewStep(newBlockCh) ensureNoNewStep(newBlockCh)
deliverTxsRange(cs, 0, 2) deliverTxsRange(cs, 0, 1)
ensureNewStep(newBlockCh) // commit txs ensureNewStep(newBlockCh) // commit txs
ensureNewStep(newBlockCh) // commit updated app hash ensureNewStep(newBlockCh) // commit updated app hash
ensureNoNewStep(newBlockCh) ensureNoNewStep(newBlockCh)
} }
func TestProgressAfterCreateEmptyBlocksInterval(t *testing.T) { func TestProgressAfterCreateEmptyBlocksInterval(t *testing.T) {
@ -72,7 +71,7 @@ func TestProgressInHigherRound(t *testing.T) {
ensureNewStep(newRoundCh) // first round at first height ensureNewStep(newRoundCh) // first round at first height
ensureNewStep(newBlockCh) // first block gets committed ensureNewStep(newBlockCh) // first block gets committed
ensureNewStep(newRoundCh) // first round at next height ensureNewStep(newRoundCh) // first round at next height
deliverTxsRange(cs, 0, 2) // we deliver txs, but dont set a proposal so we get the next round deliverTxsRange(cs, 0, 1) // we deliver txs, but dont set a proposal so we get the next round
<-timeoutCh <-timeoutCh
ensureNewStep(newRoundCh) // wait for the next round ensureNewStep(newRoundCh) // wait for the next round
ensureNewStep(newBlockCh) // now we can commit the block ensureNewStep(newBlockCh) // now we can commit the block