From 54357bcf8f8ed968e446c3e0d665a428a6b16dab Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Tue, 12 Jul 2016 14:08:59 -0400 Subject: [PATCH] crank consensus timeout parameters for tests (see #236) --- config/tendermint_test/config.go | 14 +++++++------- consensus/state_test.go | 2 ++ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/config/tendermint_test/config.go b/config/tendermint_test/config.go index 689ba794c..c53f8bfbb 100644 --- a/config/tendermint_test/config.go +++ b/config/tendermint_test/config.go @@ -86,13 +86,13 @@ func ResetConfig(localPath string) cfg.Config { mapConfig.SetDefault("block_size", 10000) 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_empty", true) mapConfig.SetDefault("mempool_broadcast", true) diff --git a/consensus/state_test.go b/consensus/state_test.go index d311512c2..9a8d60905 100644 --- a/consensus/state_test.go +++ b/consensus/state_test.go @@ -554,6 +554,8 @@ func TestLockPOLRelock(t *testing.T) { // now either we go to PrevoteWait or Precommit select { 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 case <-voteCh: // we went straight to Precommit }