config: block size, consensus timeouts, recheck tx

This commit is contained in:
Ethan Buchman
2016-02-29 16:15:23 -05:00
parent 94a1978ce4
commit c9ec9cf00e
8 changed files with 107 additions and 37 deletions

View File

@ -11,6 +11,10 @@ import (
"github.com/tendermint/tendermint/types"
)
func (tp *TimeoutParams) ensureProposeTimeout() time.Duration {
return time.Duration(tp.Propose0*2) * time.Millisecond
}
/*
ProposeSuite
@ -44,12 +48,6 @@ x * TestHalt1 - if we see +2/3 precommits after timing out into new round, we sh
//----------------------------------------------------------------------------------------------------
// ProposeSuite
func init() {
fmt.Println("")
timeoutPropose0 = 100 * time.Millisecond
timeoutProposeDelta = 1 * time.Millisecond
}
func TestProposerSelection0(t *testing.T) {
cs1, vss := randConsensusState(4)
height, round := cs1.Height, cs1.Round
@ -124,7 +122,7 @@ func TestEnterProposeNoPrivValidator(t *testing.T) {
startTestRound(cs, height, round)
// if we're not a validator, EnterPropose should timeout
ticker := time.NewTicker(timeoutPropose0 * 2)
ticker := time.NewTicker(cs.timeoutParams.ensureProposeTimeout())
select {
case <-timeoutCh:
case <-ticker.C:
@ -165,7 +163,7 @@ func TestEnterProposeYesPrivValidator(t *testing.T) {
}
// if we're a validator, enterPropose should not timeout
ticker := time.NewTicker(timeoutPropose0 * 2)
ticker := time.NewTicker(cs.timeoutParams.ensureProposeTimeout())
select {
case <-timeoutCh:
t.Fatal("Expected EnterPropose not to timeout")