From e958a98e2d72a30ea378b1410faeb450eed2bff4 Mon Sep 17 00:00:00 2001 From: Thomas Bruyelle Date: Sat, 24 Aug 2024 23:03:19 +0200 Subject: [PATCH 1/8] Revert "test: try to fix flaky test" This reverts commit 87d4c1b40acac66c914dd5968565630ae412447f. --- tests/e2e/e2e_feegrant_test.go | 6 +++--- tests/e2e/e2e_setup_test.go | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/e2e/e2e_feegrant_test.go b/tests/e2e/e2e_feegrant_test.go index 3f4913ec..316cc4e5 100644 --- a/tests/e2e/e2e_feegrant_test.go +++ b/tests/e2e/e2e_feegrant_test.go @@ -25,9 +25,9 @@ func (s *IntegrationTestSuite) testFeeGrant() { api = fmt.Sprintf("http://%s", s.valResources[c.id][valIdx].GetHostPort("1317/tcp")) ) - alice, _ := c.genesisAccounts[4].keyInfo.GetAddress() - bob, _ := c.genesisAccounts[5].keyInfo.GetAddress() - charlie, _ := c.genesisAccounts[6].keyInfo.GetAddress() + alice, _ := c.genesisAccounts[1].keyInfo.GetAddress() + bob, _ := c.genesisAccounts[2].keyInfo.GetAddress() + charlie, _ := c.genesisAccounts[3].keyInfo.GetAddress() // add fee grant from alice to bob s.execFeeGrant( diff --git a/tests/e2e/e2e_setup_test.go b/tests/e2e/e2e_setup_test.go index a5fbe435..0ea05c08 100644 --- a/tests/e2e/e2e_setup_test.go +++ b/tests/e2e/e2e_setup_test.go @@ -180,7 +180,7 @@ func (s *IntegrationTestSuite) initNodes(c *chain) { c.genesisAccounts[2]: Test Account 1 c.genesisAccounts[3]: Test Account 2 */ - s.Require().NoError(c.addAccountFromMnemonic(7)) + s.Require().NoError(c.addAccountFromMnemonic(5)) // Initialize a genesis file for the first validator val0ConfigDir := c.validators[0].configDir() var addrAll []sdk.AccAddress From 43d2ac4f10d81823ab78e614b95bc598c4eabdd6 Mon Sep 17 00:00:00 2001 From: Thomas Bruyelle Date: Sat, 24 Aug 2024 23:04:44 +0200 Subject: [PATCH 2/8] run CI test on branch --- .github/workflows/test.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4c8d9096..1e0f1468 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -6,8 +6,6 @@ on: - "**/*.md" - "docs/**" push: - branches: - - main paths-ignore: - "**/*.md" - "docs/**" From 2b49c3ea1ee3fcf46cf2420e740e9f2f9680d8c8 Mon Sep 17 00:00:00 2001 From: Thomas Bruyelle Date: Tue, 27 Aug 2024 16:31:16 +0200 Subject: [PATCH 3/8] add some logs --- tests/e2e/e2e_setup_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/e2e/e2e_setup_test.go b/tests/e2e/e2e_setup_test.go index 0ea05c08..30ad7259 100644 --- a/tests/e2e/e2e_setup_test.go +++ b/tests/e2e/e2e_setup_test.go @@ -558,11 +558,13 @@ func (s *IntegrationTestSuite) runValidators(c *chain, portOffset int) { status, err := rpcClient.Status(ctx) if err != nil { + s.T().Logf("error requesting node status: %v", err) return false } // let the node produce a few blocks if status.SyncInfo.CatchingUp || status.SyncInfo.LatestBlockHeight < 3 { + s.T().Logf("node not ready") return false } return true From efc4108ec203591bb663e5b2b62e2233be8ddbf2 Mon Sep 17 00:00:00 2001 From: Thomas Bruyelle Date: Tue, 27 Aug 2024 16:40:32 +0200 Subject: [PATCH 4/8] add container logs --- tests/e2e/e2e_setup_test.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tests/e2e/e2e_setup_test.go b/tests/e2e/e2e_setup_test.go index 30ad7259..cd68e2ae 100644 --- a/tests/e2e/e2e_setup_test.go +++ b/tests/e2e/e2e_setup_test.go @@ -558,13 +558,11 @@ func (s *IntegrationTestSuite) runValidators(c *chain, portOffset int) { status, err := rpcClient.Status(ctx) if err != nil { - s.T().Logf("error requesting node status: %v", err) return false } // let the node produce a few blocks if status.SyncInfo.CatchingUp || status.SyncInfo.LatestBlockHeight < 3 { - s.T().Logf("node not ready") return false } return true @@ -573,6 +571,15 @@ func (s *IntegrationTestSuite) runValidators(c *chain, portOffset int) { time.Second, "AtomOne node failed to produce blocks", ) + err = s.dkrPool.Client.Logs(docker.LogsOptions{ + Container: s.valResources[c.id][0].Container.ID, + OutputStream: os.Stdout, + ErrorStream: os.Stdout, + Stdout: true, + Stderr: true, + // Follow: true, + }) + fmt.Println("ERR LOGS", err) } func noRestart(config *docker.HostConfig) { From 8b5a8dc04d8ec893d3302c88e41456846c00b51e Mon Sep 17 00:00:00 2001 From: Thomas Bruyelle Date: Tue, 27 Aug 2024 16:44:14 +0200 Subject: [PATCH 5/8] fix --- tests/e2e/e2e_setup_test.go | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/tests/e2e/e2e_setup_test.go b/tests/e2e/e2e_setup_test.go index cd68e2ae..f0c0745c 100644 --- a/tests/e2e/e2e_setup_test.go +++ b/tests/e2e/e2e_setup_test.go @@ -551,6 +551,17 @@ func (s *IntegrationTestSuite) runValidators(c *chain, portOffset int) { rpcClient, err := rpchttp.New("tcp://localhost:26657", "/websocket") s.Require().NoError(err) + defer func() { + err = s.dkrPool.Client.Logs(docker.LogsOptions{ + Container: s.valResources[c.id][0].Container.ID, + OutputStream: os.Stdout, + ErrorStream: os.Stdout, + Stdout: true, + Stderr: true, + // Follow: true, + }) + fmt.Println("ERR LOGS", err) + }() s.Require().Eventually( func() bool { ctx, cancel := context.WithTimeout(context.Background(), time.Second*5) @@ -571,15 +582,6 @@ func (s *IntegrationTestSuite) runValidators(c *chain, portOffset int) { time.Second, "AtomOne node failed to produce blocks", ) - err = s.dkrPool.Client.Logs(docker.LogsOptions{ - Container: s.valResources[c.id][0].Container.ID, - OutputStream: os.Stdout, - ErrorStream: os.Stdout, - Stdout: true, - Stderr: true, - // Follow: true, - }) - fmt.Println("ERR LOGS", err) } func noRestart(config *docker.HostConfig) { From b4b71325bbe1fae8895d6a20743f3c98cbf57f45 Mon Sep 17 00:00:00 2001 From: Adam Hanna Date: Tue, 27 Aug 2024 09:04:35 -0700 Subject: [PATCH 6/8] adds log --- app/app.go | 2 ++ go.mod | 2 +- tests/e2e/e2e_setup_test.go | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/app.go b/app/app.go index 2d7a0cd3..329ae528 100644 --- a/app/app.go +++ b/app/app.go @@ -7,6 +7,7 @@ import ( "os" "path/filepath" + "github.com/davecgh/go-spew/spew" "github.com/gorilla/mux" "github.com/rakyll/statik/fs" "github.com/spf13/cast" @@ -261,6 +262,7 @@ func (app *AtomOneApp) InitChainer(ctx sdk.Context, req abci.RequestInitChain) a if err := tmjson.Unmarshal(req.AppStateBytes, &genesisState); err != nil { panic(err) } + fmt.Printf("genesisState: %v\n", spew.Sdump(genesisState)) app.UpgradeKeeper.SetModuleVersionMap(ctx, app.mm.GetVersionMap()) diff --git a/go.mod b/go.mod index 490dad2b..27ca703e 100644 --- a/go.mod +++ b/go.mod @@ -14,6 +14,7 @@ require ( github.com/cometbft/cometbft-db v0.10.0 github.com/cosmos/cosmos-sdk v0.47.10 github.com/cosmos/go-bip39 v1.0.0 + github.com/davecgh/go-spew v1.1.1 github.com/golang/mock v1.6.0 github.com/google/gofuzz v1.2.0 github.com/gorilla/mux v1.8.1 @@ -78,7 +79,6 @@ require ( github.com/cosmos/rosetta-sdk-go v0.10.0 // indirect github.com/creachadair/taskgroup v0.4.2 // indirect github.com/danieljoos/wincred v1.1.2 // indirect - github.com/davecgh/go-spew v1.1.1 // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0 // indirect github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect github.com/dgraph-io/badger/v2 v2.2007.4 // indirect diff --git a/tests/e2e/e2e_setup_test.go b/tests/e2e/e2e_setup_test.go index 8da315ab..51fa2c4e 100644 --- a/tests/e2e/e2e_setup_test.go +++ b/tests/e2e/e2e_setup_test.go @@ -541,6 +541,7 @@ func (s *IntegrationTestSuite) runValidators(c *chain, portOffset int) { } } + fmt.Println(fmt.Sprintf("%s:%s", runOpts.Repository, runOpts.Tag)) resource, err := s.dkrPool.RunWithOptions(runOpts, noRestart) s.Require().NoError(err) From 575bd084d5a99287525d88f7e820f336eac9bdac Mon Sep 17 00:00:00 2001 From: Adam Hanna Date: Tue, 27 Aug 2024 09:25:53 -0700 Subject: [PATCH 7/8] tmp --- .github/workflows/test.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4c8d9096..e62765ce 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -6,8 +6,6 @@ on: - "**/*.md" - "docs/**" push: - branches: - - main paths-ignore: - "**/*.md" - "docs/**" @@ -128,4 +126,4 @@ jobs: - name: Test Local Network Liveness run: | ./contrib/scripts/test_localnet_liveness.sh 100 5 50 localhost - if: env.GIT_DIFF + if: env.GIT_DIFF \ No newline at end of file From 2009174ec9c9985485418f717ca7b0d964c3026b Mon Sep 17 00:00:00 2001 From: Adam Hanna Date: Tue, 27 Aug 2024 10:01:36 -0700 Subject: [PATCH 8/8] tmp --- Makefile | 4 ++-- app/app.go | 6 ++++-- go.mod | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index af2b6996..a5f29080 100644 --- a/Makefile +++ b/Makefile @@ -208,10 +208,10 @@ $(TEST_TARGETS): run-tests run-tests: ifneq (,$(shell which tparse 2>/dev/null)) @echo "--> Running tests" - @go test -mod=readonly -json $(ARGS) $(TEST_PACKAGES) | tparse + @go test -v -mod=readonly -json $(ARGS) $(TEST_PACKAGES) | tparse else @echo "--> Running tests" - @go test -mod=readonly $(ARGS) $(TEST_PACKAGES) + @go test -v -mod=readonly $(ARGS) $(TEST_PACKAGES) endif .PHONY: run-tests $(TEST_TARGETS) diff --git a/app/app.go b/app/app.go index 329ae528..c086f7e8 100644 --- a/app/app.go +++ b/app/app.go @@ -7,7 +7,6 @@ import ( "os" "path/filepath" - "github.com/davecgh/go-spew/spew" "github.com/gorilla/mux" "github.com/rakyll/statik/fs" "github.com/spf13/cast" @@ -262,7 +261,10 @@ func (app *AtomOneApp) InitChainer(ctx sdk.Context, req abci.RequestInitChain) a if err := tmjson.Unmarshal(req.AppStateBytes, &genesisState); err != nil { panic(err) } - fmt.Printf("genesisState: %v\n", spew.Sdump(genesisState)) + // Print each entry in the map as a string + for key, value := range genesisState { + fmt.Printf("%s: %s\n", key, string(value)) + } app.UpgradeKeeper.SetModuleVersionMap(ctx, app.mm.GetVersionMap()) diff --git a/go.mod b/go.mod index 27ca703e..490dad2b 100644 --- a/go.mod +++ b/go.mod @@ -14,7 +14,6 @@ require ( github.com/cometbft/cometbft-db v0.10.0 github.com/cosmos/cosmos-sdk v0.47.10 github.com/cosmos/go-bip39 v1.0.0 - github.com/davecgh/go-spew v1.1.1 github.com/golang/mock v1.6.0 github.com/google/gofuzz v1.2.0 github.com/gorilla/mux v1.8.1 @@ -79,6 +78,7 @@ require ( github.com/cosmos/rosetta-sdk-go v0.10.0 // indirect github.com/creachadair/taskgroup v0.4.2 // indirect github.com/danieljoos/wincred v1.1.2 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0 // indirect github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect github.com/dgraph-io/badger/v2 v2.2007.4 // indirect