Browse Source

crank consensus timeout parameters for tests (see #236)

pull/233/head
Ethan Buchman 9 years ago
parent
commit
54357bcf8f
2 changed files with 9 additions and 7 deletions
  1. +7
    -7
      config/tendermint_test/config.go
  2. +2
    -0
      consensus/state_test.go

+ 7
- 7
config/tendermint_test/config.go View File

@ -86,13 +86,13 @@ func ResetConfig(localPath string) cfg.Config {
mapConfig.SetDefault("block_size", 10000) mapConfig.SetDefault("block_size", 10000)
mapConfig.SetDefault("disable_data_hash", false) mapConfig.SetDefault("disable_data_hash", false)
mapConfig.SetDefault("timeout_propose", 100)
mapConfig.SetDefault("timeout_propose_delta", 1)
mapConfig.SetDefault("timeout_prevote", 1)
mapConfig.SetDefault("timeout_prevote_delta", 1)
mapConfig.SetDefault("timeout_precommit", 1)
mapConfig.SetDefault("timeout_precommit_delta", 1)
mapConfig.SetDefault("timeout_commit", 1)
mapConfig.SetDefault("timeout_propose", 3000)
mapConfig.SetDefault("timeout_propose_delta", 1000)
mapConfig.SetDefault("timeout_prevote", 2000)
mapConfig.SetDefault("timeout_prevote_delta", 1000)
mapConfig.SetDefault("timeout_precommit", 2000)
mapConfig.SetDefault("timeout_precommit_delta", 1000)
mapConfig.SetDefault("timeout_commit", 1000)
mapConfig.SetDefault("mempool_recheck", true) mapConfig.SetDefault("mempool_recheck", true)
mapConfig.SetDefault("mempool_recheck_empty", true) mapConfig.SetDefault("mempool_recheck_empty", true)
mapConfig.SetDefault("mempool_broadcast", true) mapConfig.SetDefault("mempool_broadcast", true)


+ 2
- 0
consensus/state_test.go View File

@ -554,6 +554,8 @@ func TestLockPOLRelock(t *testing.T) {
// now either we go to PrevoteWait or Precommit // now either we go to PrevoteWait or Precommit
select { select {
case <-timeoutWaitCh: // we're in PrevoteWait, go to Precommit case <-timeoutWaitCh: // we're in PrevoteWait, go to Precommit
// XXX: there's no guarantee we see the polka, this might be a precommit for nil,
// in which case the test fails!
<-voteCh <-voteCh
case <-voteCh: // we went straight to Precommit case <-voteCh: // we went straight to Precommit
} }


Loading…
Cancel
Save