Skip to content

Commit

Permalink
test: improve times
Browse files Browse the repository at this point in the history
  • Loading branch information
facundomedica committed Jul 3, 2023
1 parent af70970 commit 90c81fb
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion sdkclient/tx/gov.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
11 changes: 5 additions & 6 deletions tests/e2e/e2e_ibc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func (s *E2ETest) checkOutflows(umeeAPIEndpoint, denom string, checkWithExcRate
return true
},
time.Minute,
5*time.Second,
2*time.Second,
)
}

Expand All @@ -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,
)
}

Expand Down Expand Up @@ -156,7 +156,7 @@ func (s *E2ETest) TestIBCTokenTransfer() {
return false
},
5*time.Minute,
5*time.Second,
2*time.Second,
)

/****
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions tests/e2e/scripts/gaia_bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 3 additions & 3 deletions tests/e2e/setup/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions tests/e2e/setup/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/grpc/historical.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 90c81fb

Please sign in to comment.