Skip to content

Commit

Permalink
Make the simulator use a random seed
Browse files Browse the repository at this point in the history
  • Loading branch information
p-offtermatt committed Jul 26, 2024
1 parent 74b4b94 commit 9b9a945
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -151,12 +151,12 @@ verify-models:
# Run a full simulation test
sim-full:
cd app/provider;\
go test -mod=readonly . -run=^TestFullAppSimulation$ -Enabled=true -NumBlocks=500 -BlockSize=200 -Commit=true -timeout 24h -v
go test -mod=readonly . -run=^TestFullAppSimulation$ -Enabled=true -NumBlocks=500 -BlockSize=200 -Commit=true -timeout 24h -v -Seed=$$RANDOM

# Run full simulation without any inactive validators
sim-full-no-inactive-vals:
cd app/provider;\
go test -mod=readonly . -run=^TestFullAppSimulation$ -Enabled=true -NumBlocks=500 -BlockSize=200 -Commit=true -timeout 24h -Params=no_inactive_vals_params.json -v
go test -mod=readonly . -run=^TestFullAppSimulation$ -Enabled=true -NumBlocks=500 -BlockSize=200 -Commit=true -timeout 24h -Params=no_inactive_vals_params.json -Seed=$$RANDOM -v


###############################################################################
Expand Down
5 changes: 4 additions & 1 deletion app/provider/sim_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ import (
simtypes "github.com/cosmos/cosmos-sdk/types/simulation"

providerapp "github.com/cosmos/interchain-security/v5/app/provider"

spew "github.com/davecgh/go-spew/spew"
)

func init() {
Expand All @@ -41,7 +43,8 @@ func TestFullAppSimulation(t *testing.T) {
config.ChainID = "provi"

fmt.Println("========================================")
fmt.Println(config)
fmt.Println("Running with the configuration:")
fmt.Println(spew.Sdump(config))
fmt.Println("========================================")

db, dir, logger, skip, err := simtestutil.SetupSimulation(config, "leveldb-app-sim", "Simulation", simcli.FlagVerboseValue, simcli.FlagEnabledValue)
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ require (
github.com/go-logfmt/logfmt v0.6.0 // indirect
github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect
github.com/gogo/googleapis v1.4.1 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/gogo/protobuf v1.3.2
github.com/golang/glog v1.2.1 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/snappy v0.0.4 // indirect
Expand Down

0 comments on commit 9b9a945

Please sign in to comment.