From 90c81fb32e50d7e34968735ee8894e4cb4e6f755 Mon Sep 17 00:00:00 2001 From: Facundo Medica Date: Mon, 3 Jul 2023 22:55:49 +0200 Subject: [PATCH] test: improve times --- Makefile | 2 +- sdkclient/tx/gov.go | 2 +- tests/e2e/e2e_ibc_test.go | 11 +++++------ tests/e2e/scripts/gaia_bootstrap.sh | 1 + tests/e2e/setup/setup.go | 6 +++--- tests/e2e/setup/utils.go | 4 ++-- tests/grpc/historical.go | 2 +- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Makefile b/Makefile index cb80315b8a..8ff5973297 100644 --- a/Makefile +++ b/Makefile @@ -231,7 +231,7 @@ cover-html: test-unit-cover # we should be able to optimize docker build: # https://linear.app/umee/issue/UMEE-463/fix-docker-login-problem-when-running-e2e-tests -test-e2e: $(TEST_E2E_DEPS) +test-e2e: #$(TEST_E2E_DEPS) go test ./tests/e2e/... -mod=readonly -timeout 30m -race -v -tags='$(TEST_E2E_TAGS)' test-e2e-cov: $(TEST_E2E_DEPS) diff --git a/sdkclient/tx/gov.go b/sdkclient/tx/gov.go index e84860faeb..e49c5d304f 100644 --- a/sdkclient/tx/gov.go +++ b/sdkclient/tx/gov.go @@ -90,7 +90,7 @@ func (c *Client) TxGovVoteYesAll(proposalID uint64) error { if _, err = BroadcastTx(*c.ClientContext, *c.txFactory, []sdk.Msg{msg}...); err == nil { break } - time.Sleep(time.Second * 1) + time.Sleep(time.Millisecond * 500) } if err != nil { diff --git a/tests/e2e/e2e_ibc_test.go b/tests/e2e/e2e_ibc_test.go index ec8e959c78..01f416c1cc 100644 --- a/tests/e2e/e2e_ibc_test.go +++ b/tests/e2e/e2e_ibc_test.go @@ -37,7 +37,7 @@ func (s *E2ETest) checkOutflows(umeeAPIEndpoint, denom string, checkWithExcRate return true }, time.Minute, - 5*time.Second, + 2*time.Second, ) } @@ -50,7 +50,7 @@ func (s *E2ETest) checkSupply(endpoint, ibcDenom string, amount math.Int) { return supply.AmountOf(ibcDenom).Equal(amount) }, time.Minute, - 5*time.Second, + 2*time.Second, ) } @@ -156,7 +156,7 @@ func (s *E2ETest) TestIBCTokenTransfer() { return false }, 5*time.Minute, - 5*time.Second, + 2*time.Second, ) /**** @@ -185,12 +185,11 @@ func (s *E2ETest) TestIBCTokenTransfer() { return a.Equal(sdk.ZeroDec()) }, time.Minute, - 5*time.Second, + 2*time.Second, ) // resend the umee token from gaia to umee s.SendIBC(setup.GaiaChainID, s.Chain.ID, "", sdk.NewInt64Coin(umeeIBCHash, token.Amount.Int64())) s.checkSupply(gaiaAPIEndpoint, umeeIBCHash, sdk.ZeroInt()) - }) // IBC inbound transfer of non x/leverage registered tokens must fail, because @@ -220,7 +219,7 @@ func (s *E2ETest) TestIBCTokenTransfer() { return token.Amount.Equal(balances.AmountOf(stakeIBCHash)) }, time.Minute, - 5*time.Second, + 2*time.Second, ) // s.checkSupply(umeeAPIEndpoint, stakeIBCHash, math.ZeroInt()) s.checkSupply(umeeAPIEndpoint, stakeIBCHash, token.Amount) diff --git a/tests/e2e/scripts/gaia_bootstrap.sh b/tests/e2e/scripts/gaia_bootstrap.sh index 42fee13c8f..ca7ed3162f 100755 --- a/tests/e2e/scripts/gaia_bootstrap.sh +++ b/tests/e2e/scripts/gaia_bootstrap.sh @@ -9,4 +9,5 @@ gaiad gentx val01 500000000000stake --chain-id=$UMEE_E2E_GAIA_CHAIN_ID --keyring gaiad collect-gentxs sed -i 's/127.0.0.1:26657/0.0.0.0:26657/g' /root/.gaia/config/config.toml sed -i -e 's/enable = false/enable = true/g' /root/.gaia/config/app.toml +sed -i 's/timeout_commit = "5s"/timeout_commit = "1s"/g' /root/.gaia/config/config.toml gaiad start --x-crisis-skip-assert-invariants diff --git a/tests/e2e/setup/setup.go b/tests/e2e/setup/setup.go index 0a3ec88a8f..adb943006f 100644 --- a/tests/e2e/setup/setup.go +++ b/tests/e2e/setup/setup.go @@ -58,7 +58,6 @@ type E2ETestSuite struct { Umee client.Client cdc codec.Codec MinNetwork bool // MinNetwork defines which runs only validator wihtout price-feeder, gaia and ibc-relayer - } func (s *E2ETestSuite) SetupSuite() { @@ -215,8 +214,8 @@ func (s *E2ETestSuite) initGenesis() { var govGenState govtypesv1.GenesisState s.Require().NoError(s.cdc.UnmarshalJSON(appGenState[govtypes.ModuleName], &govGenState)) - votingPeroid := 5 * time.Second - govGenState.VotingParams.VotingPeriod = &votingPeroid + votingPeriod := 6 * time.Second + govGenState.VotingParams.VotingPeriod = &votingPeriod govGenState.DepositParams.MinDeposit = sdk.NewCoins(sdk.NewCoin(appparams.BondDenom, sdk.NewInt(100))) bz, err = s.cdc.MarshalJSON(&govGenState) @@ -312,6 +311,7 @@ func (s *E2ETestSuite) initValidatorConfigs() { s.Require().NoError(vpr.ReadInConfig()) valConfig := tmconfig.DefaultConfig() + valConfig.Consensus.TimeoutCommit = 1500 * time.Millisecond s.Require().NoError(vpr.Unmarshal(valConfig)) valConfig.P2P.ListenAddress = "tcp://0.0.0.0:26656" diff --git a/tests/e2e/setup/utils.go b/tests/e2e/setup/utils.go index dbbe15b974..8c102e4ecc 100644 --- a/tests/e2e/setup/utils.go +++ b/tests/e2e/setup/utils.go @@ -79,8 +79,8 @@ func (s *E2ETestSuite) SendIBC(srcChainID, dstChainID, recipient string, token s "failed to send IBC tokens; stdout: %s, stderr: %s", outBuf.String(), errBuf.String(), ) s.T().Log("successfully sent IBC tokens") - s.T().Log("Waiting for 12 seconds to make sure trasaction is processed or include in the block") - time.Sleep(time.Second * 12) + s.T().Log("Waiting for 3 seconds to make sure trasaction is processed or include in the block") + time.Sleep(time.Second * 3) } // QueryREST make http query to grpc-web endpoint and tries to decode valPtr using proto-JSON diff --git a/tests/grpc/historical.go b/tests/grpc/historical.go index 3a8d5eca70..465488110a 100644 --- a/tests/grpc/historical.go +++ b/tests/grpc/historical.go @@ -33,7 +33,7 @@ func MedianCheck(umee client.Client) error { } var exchangeRates sdk.DecCoins - for i := 0; i < 20; i++ { + for i := 0; i < 50; i++ { exchangeRates, err = umee.QueryExchangeRates() if err == nil && len(exchangeRates) == len(denomAcceptList) { break