Skip to content

Commit

Permalink
fix(simulator): determinism test
Browse files Browse the repository at this point in the history
  • Loading branch information
fmorency committed Jun 27, 2024
1 parent 3c97f29 commit d30b11b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app/sim_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package app_test

import (
"encoding/hex"
"encoding/json"
"flag"
"fmt"
Expand Down Expand Up @@ -425,6 +426,7 @@ func TestAppStateDeterminism(t *testing.T) {
config.ExportParamsPath = ""
config.OnOperation = true
config.AllInvariants = true
config.ChainID = SimAppChainID

numSeeds := 3
numTimesToRunPerSeed := 3 // This used to be set to 5, but we've temporarily reduced it to 3 for the sake of faster CI.
Expand Down Expand Up @@ -464,8 +466,6 @@ func TestAppStateDeterminism(t *testing.T) {
} else {
logger = log.NewNopLogger()
}
chainID := fmt.Sprintf("chain-id-%d-%d", i, j)
config.ChainID = chainID

err := setPOAAdmin(config)
require.NoError(t, err)
Expand All @@ -479,7 +479,7 @@ func TestAppStateDeterminism(t *testing.T) {
SimulatorCommissionRateMinMax,
appOptions,
interBlockCacheOpt(),
baseapp.SetChainID(chainID),
baseapp.SetChainID(SimAppChainID),
)

fmt.Printf(
Expand Down Expand Up @@ -513,7 +513,7 @@ func TestAppStateDeterminism(t *testing.T) {

if j != 0 {
require.Equal(
t, string(appHashList[0]), string(appHashList[j]),
t, hex.EncodeToString(appHashList[0]), hex.EncodeToString(appHashList[j]),
"non-determinism in seed %d: %d/%d, attempt: %d/%d\n", config.Seed, i+1, numSeeds, j+1, numTimesToRunPerSeed,
)
}
Expand Down

0 comments on commit d30b11b

Please sign in to comment.