Skip to content

Commit

Permalink
Fix more consensus test
Browse files Browse the repository at this point in the history
  • Loading branch information
teddyding committed Nov 26, 2024
1 parent 9f11ce4 commit c503f70
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions consensus/common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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 {
Expand Down
3 changes: 3 additions & 0 deletions consensus/reactor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit c503f70

Please sign in to comment.