fix tests

This commit is contained in:
Callum Waters
2022-10-08 22:33:27 +02:00
parent 70724ca979
commit 7f0eed6a63
3 changed files with 13 additions and 6 deletions
+11 -3
View File
@@ -802,6 +802,7 @@ func randConsensusNetWithPeers(
stateStore := sm.NewStore(stateDB, sm.StoreOptions{
DiscardFinalizeBlockResponses: false,
})
t.Cleanup(func() { _ = stateStore.Close() })
state, _ := stateStore.LoadFromDBOrGenesisDoc(genDoc)
thisConfig := ResetConfig(fmt.Sprintf("%s_%d", testName, i))
configRootDirs = append(configRootDirs, thisConfig.RootDir)
@@ -813,9 +814,16 @@ func randConsensusNetWithPeers(
if i < nValidators {
privVal = privVals[i]
} else {
tempKeyFile := t.TempDir()
tempStateFile := t.TempDir()
privVal = privval.GenFilePV(tempKeyFile, tempStateFile)
tempKeyFile, err := os.CreateTemp("", "priv_validator_key_")
if err != nil {
panic(err)
}
tempStateFile, err := os.CreateTemp("", "priv_validator_state_")
if err != nil {
panic(err)
}
privVal = privval.GenFilePV(tempKeyFile.Name(), tempStateFile.Name())
}
app := appFunc(path.Join(config.DBDir(), fmt.Sprintf("%s_%d", testName, i)))
+1 -1
View File
@@ -409,7 +409,6 @@ func TestReactorVotingPowerChange(t *testing.T) {
}
func TestReactorValidatorSetChanges(t *testing.T) {
t.Skip()
nPeers := 7
nVals := 4
css, _, _, cleanup := randConsensusNetWithPeers(
@@ -563,6 +562,7 @@ func waitForAndValidateBlock(
for _, tx := range txs {
err := assertMempool(css[j].txNotifier).CheckTx(tx, func(resp *abci.ResponseCheckTx) {
require.False(t, resp.IsErr())
fmt.Println(resp)
}, mempl.TxInfo{})
require.NoError(t, err)
}
+1 -2
View File
@@ -26,7 +26,6 @@ import (
"github.com/tendermint/tendermint/libs/log"
tmrand "github.com/tendermint/tendermint/libs/rand"
"github.com/tendermint/tendermint/mempool"
mempl "github.com/tendermint/tendermint/mempool"
"github.com/tendermint/tendermint/privval"
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
"github.com/tendermint/tendermint/proxy"
@@ -115,7 +114,7 @@ func sendTxs(ctx context.Context, cs *State) {
if resp.Code != 0 {
panic(fmt.Sprintf("Unexpected code: %d, log: %s", resp.Code, resp.Log))
}
}, mempl.TxInfo{}); err != nil {
}, mempool.TxInfo{}); err != nil {
panic(err)
}
i++