From 657420b17e55a3b3306242b4e16ca7c4bf4cbe98 Mon Sep 17 00:00:00 2001 From: pinosu <95283998+pinosu@users.noreply.github.com> Date: Mon, 19 Jun 2023 11:08:49 +0200 Subject: [PATCH] Edit config to speed up debugging (#1447) * Edit config to speed up debugging * Make test deterministic * Restore test-sim-deterministic --- .circleci/config.yml | 2 +- Makefile | 2 +- app/sim_test.go | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 025ecbae..87819b71 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -138,7 +138,7 @@ jobs: - run: name: Run simulations command: | - make test-sim-multi-seed-short test-sim-import-export test-sim-deterministic + make test-sim-deterministic test-sim-multi-seed-short test-sim-import-export - store_artifacts: path: /tmp diff --git a/Makefile b/Makefile index d42bf5cf..6e4eb965 100644 --- a/Makefile +++ b/Makefile @@ -148,7 +148,7 @@ test-sim-multi-seed-short: runsim @$(BINDIR)/runsim -Jobs=4 -SimAppPkg=$(SIMAPP) -ExitOnFail 50 5 TestFullAppSimulation test-sim-deterministic: runsim - @echo "Running short multi-seed application simulation. This may take awhile!" + @echo "Running application deterministic simulation. This may take awhile!" @$(BINDIR)/runsim -Jobs=4 -SimAppPkg=$(SIMAPP) -ExitOnFail 1 1 TestAppStateDeterminism test-system: install diff --git a/app/sim_test.go b/app/sim_test.go index 627c0c29..31390fdc 100644 --- a/app/sim_test.go +++ b/app/sim_test.go @@ -3,7 +3,6 @@ package app import ( "encoding/json" "fmt" - "math/rand" "os" "runtime/debug" "strings" @@ -304,7 +303,7 @@ func TestAppStateDeterminism(t *testing.T) { appOptions[server.FlagInvCheckPeriod] = simcli.FlagPeriodValue for i := 0; i < numSeeds; i++ { - config.Seed = rand.Int63() + config.Seed += int64(i) for j := 0; j < numTimesToRunPerSeed; j++ { var logger log.Logger