diff --git a/consensus/common_test.go b/consensus/common_test.go index cff898c25fe..6d2220bc6c0 100644 --- a/consensus/common_test.go +++ b/consensus/common_test.go @@ -778,6 +778,8 @@ func randConsensusNet(t *testing.T, nValidators int, testName string, tickerFunc }) state, _ := stateStore.LoadFromDBOrGenesisDoc(genDoc) thisConfig := ResetConfig(fmt.Sprintf("%s_%d", testName, i)) + // Set timeout to 0 so `skipTimeoutCommit = true` during test. + thisConfig.Consensus.TimeoutCommit = 0 configRootDirs = append(configRootDirs, thisConfig.RootDir) for _, opt := range configOpts { opt(thisConfig) @@ -822,6 +824,9 @@ func randConsensusNetWithPeers( t.Cleanup(func() { _ = stateStore.Close() }) state, _ := stateStore.LoadFromDBOrGenesisDoc(genDoc) thisConfig := ResetConfig(fmt.Sprintf("%s_%d", testName, i)) + // Set timeout to 0 so `skipTimeoutCommit = true` during test. + thisConfig.Consensus.TimeoutCommit = 0 + configRootDirs = append(configRootDirs, thisConfig.RootDir) ensureDir(filepath.Dir(thisConfig.Consensus.WalFile()), 0o700) // dir for wal if i == 0 { diff --git a/consensus/reactor_test.go b/consensus/reactor_test.go index 0328db4dfaa..d272f9e133d 100644 --- a/consensus/reactor_test.go +++ b/consensus/reactor_test.go @@ -142,6 +142,8 @@ func TestReactorWithEvidence(t *testing.T) { }) state, _ := stateStore.LoadFromDBOrGenesisDoc(genDoc) thisConfig := ResetConfig(fmt.Sprintf("%s_%d", testName, i)) + // Set timeout to 0 so `skipTimeoutCommit = true` during test. + thisConfig.Consensus.TimeoutCommit = 0 defer os.RemoveAll(thisConfig.RootDir) ensureDir(path.Dir(thisConfig.Consensus.WalFile()), 0o700) // dir for wal app := appFunc() @@ -448,6 +450,7 @@ func TestReactorVotingPowerChange(t *testing.T) { "consensus_voting_power_changes_test", newMockTickerFunc(true), newPersistentKVStore) + defer cleanup() reactors, blocksSubs, eventBuses := startConsensusNet(t, css, nVals) defer stopConsensusNet(logger, reactors, eventBuses)