Skip to content

Commit dc390de

Browse files
fix: Optimise sleep and wait functions in upgrade tests [DEV-5514] & Optimise sleep funtions in fee abs tests [DEV-5515] (#942)
* optimized sleep and wait functions in tests * revert wait time
1 parent a2f97a7 commit dc390de

4 files changed

Lines changed: 15 additions & 15 deletions

File tree

tests/fee-abs/fee-abs-test.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ docker compose exec -d osmosis osmosisd start
8282

8383
info "Waiting for chains"
8484
# TODO: Get rid of this
85-
sleep 20
85+
sleep 10
8686

8787
info "Checking statuses"
8888
CHEQD_STATUS=$(docker compose exec cheqd cheqd-noded status 2>&1)
@@ -211,7 +211,7 @@ RES=$(docker compose exec cheqd cheqd-noded tx feeabs fund 200000000000000000nch
211211
assert_tx_successful "${RES}"
212212

213213
info "wait for exchange rate to be updated"
214-
sleep 600
214+
sleep 150
215215

216216
info "pay fees using osmo in cheqd (recursively)"
217217
# shellcheck disable=SC2034

tests/upgrade/integration/v4/param_change_proposal_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ var _ = Describe("Upgrade - Fee parameter change proposal", func() {
4343
Expect(err).To(BeNil())
4444

4545
By("waiting for the proposal to be included in a block")
46-
err = cli.WaitForChainHeight(cli.Validator0, cli.CliBinaryName, currentHeight+2, cli.VotingPeriod*3)
46+
err = cli.WaitForChainHeight(cli.Validator0, cli.CliBinaryName, currentHeight+2, cli.VotingPeriod*1)
4747
Expect(err).To(BeNil())
4848
})
4949

@@ -81,7 +81,7 @@ var _ = Describe("Upgrade - Fee parameter change proposal", func() {
8181
Expect(err).To(BeNil())
8282

8383
By("waiting for the proposal to pass")
84-
err = cli.WaitForChainHeight(cli.Validator0, cli.CliBinaryName, currentHeight+10, cli.VotingPeriod*2)
84+
err = cli.WaitForChainHeight(cli.Validator0, cli.CliBinaryName, currentHeight+10, cli.VotingPeriod*1)
8585
Expect(err).To(BeNil())
8686
})
8787

@@ -129,7 +129,7 @@ var _ = Describe("Upgrade - Fee parameter change proposal", func() {
129129
Expect(err).To(BeNil())
130130

131131
By("waiting for the proposal to be included in a block")
132-
err = cli.WaitForChainHeight(cli.Validator0, cli.CliBinaryName, currentHeight+2, cli.VotingPeriod*2)
132+
err = cli.WaitForChainHeight(cli.Validator0, cli.CliBinaryName, currentHeight+2, cli.VotingPeriod*1)
133133
Expect(err).To(BeNil())
134134
})
135135

tests/upgrade/integration/v4/post_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ var _ = Describe("Upgrade - Post", func() {
5050
Expect(err).To(BeNil())
5151

5252
By("waiting for 10 blocks to be produced on top, after the upgrade")
53-
err = cli.WaitForChainHeight(cli.Validator0, cli.CliBinaryName, currentHeight+10, cli.VotingPeriod*6)
53+
err = cli.WaitForChainHeight(cli.Validator0, cli.CliBinaryName, currentHeight+10, cli.VotingPeriod*2)
5454
Expect(err).To(BeNil())
5555
})
5656

@@ -83,7 +83,7 @@ var _ = Describe("Upgrade - Post", func() {
8383
Expect(err).To(BeNil())
8484

8585
By("waiting for 10 blocks to be produced on top")
86-
err = cli.WaitForChainHeight(cli.Validator2, cli.CliBinaryName, currentHeight+10, cli.VotingPeriod*8)
86+
err = cli.WaitForChainHeight(cli.Validator2, cli.CliBinaryName, currentHeight+10, cli.VotingPeriod*2)
8787
Expect(err).To(BeNil())
8888
})
8989

tests/upgrade/integration/v4/pre_test.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ var _ = Describe("Upgrade - Pre", func() {
3939
Context("Before a software upgrade execution is initiated", func() {
4040
It("should wait for chain to bootstrap", func() {
4141
By("pinging the node status until the voting end height is reached")
42-
err := cli.WaitForChainHeight(cli.Validator0, cli.CliBinaryName, cli.BootstrapHeight, cli.BootstrapPeriod+20)
42+
err := cli.WaitForChainHeight(cli.Validator0, cli.CliBinaryName, cli.BootstrapHeight, cli.BootstrapPeriod+5)
4343
Expect(err).To(BeNil())
4444
})
4545

@@ -67,7 +67,7 @@ var _ = Describe("Upgrade - Pre", func() {
6767
By("waiting for an additional set of blocks to be produced")
6868
height, err := cli.GetCurrentBlockHeight(cli.Validator0, cli.CliBinaryName)
6969
Expect(err).To(BeNil())
70-
err = cli.WaitForChainHeight(cli.Validator0, cli.CliBinaryName, height+5, cli.VotingPeriod*6)
70+
err = cli.WaitForChainHeight(cli.Validator0, cli.CliBinaryName, height+5, cli.VotingPeriod*2)
7171
Expect(err).To(BeNil())
7272
}
7373
})
@@ -107,7 +107,7 @@ var _ = Describe("Upgrade - Pre", func() {
107107
By("waiting for an additional set of blocks to be produced")
108108
height, err := cli.GetCurrentBlockHeight(cli.Validator0, cli.CliBinaryName)
109109
Expect(err).To(BeNil())
110-
err = cli.WaitForChainHeight(cli.Validator0, cli.CliBinaryName, height+5, cli.VotingPeriod*6)
110+
err = cli.WaitForChainHeight(cli.Validator0, cli.CliBinaryName, height+5, cli.VotingPeriod*2)
111111
Expect(err).To(BeNil())
112112
}
113113
})
@@ -137,7 +137,7 @@ var _ = Describe("Upgrade - Pre", func() {
137137
Expect(err).To(BeNil())
138138

139139
By("waiting for 10 blocks to be produced on top, after the upgrade")
140-
err = cli.WaitForChainHeight(cli.Validator0, cli.CliBinaryName, currentHeight+3, cli.VotingPeriod*3)
140+
err = cli.WaitForChainHeight(cli.Validator0, cli.CliBinaryName, currentHeight+3, cli.VotingPeriod*1)
141141
Expect(err).To(BeNil())
142142
})
143143

@@ -154,7 +154,7 @@ var _ = Describe("Upgrade - Pre", func() {
154154
Expect(err).To(BeNil())
155155

156156
By("waiting for the proposal to be included in a block")
157-
err = cli.WaitForChainHeight(cli.Validator0, cli.CliBinaryName, currentHeight+3, cli.VotingPeriod*3)
157+
err = cli.WaitForChainHeight(cli.Validator0, cli.CliBinaryName, currentHeight+3, cli.VotingPeriod*1)
158158
Expect(err).To(BeNil())
159159
})
160160

@@ -171,7 +171,7 @@ var _ = Describe("Upgrade - Pre", func() {
171171
Expect(err).To(BeNil())
172172

173173
By("waiting for 10 blocks to be produced on top, after the upgrade")
174-
err = cli.WaitForChainHeight(cli.Validator0, cli.CliBinaryName, currentHeight+1, cli.VotingPeriod*2)
174+
err = cli.WaitForChainHeight(cli.Validator0, cli.CliBinaryName, currentHeight+1, cli.VotingPeriod*1)
175175
Expect(err).To(BeNil())
176176
})
177177

@@ -188,7 +188,7 @@ var _ = Describe("Upgrade - Pre", func() {
188188
Expect(err).To(BeNil())
189189

190190
By("waiting for 10 blocks to be produced on top, after the upgrade")
191-
err = cli.WaitForChainHeight(cli.Validator0, cli.CliBinaryName, currentHeight+1, cli.VotingPeriod*2)
191+
err = cli.WaitForChainHeight(cli.Validator0, cli.CliBinaryName, currentHeight+1, cli.VotingPeriod*1)
192192
Expect(err).To(BeNil())
193193
})
194194

@@ -205,7 +205,7 @@ var _ = Describe("Upgrade - Pre", func() {
205205
Expect(err).To(BeNil())
206206

207207
By("waiting for 10 blocks to be produced on top, after the upgrade")
208-
err = cli.WaitForChainHeight(cli.Validator0, cli.CliBinaryName, currentHeight+1, cli.VotingPeriod*2)
208+
err = cli.WaitForChainHeight(cli.Validator0, cli.CliBinaryName, currentHeight+1, cli.VotingPeriod*1)
209209
Expect(err).To(BeNil())
210210
})
211211

0 commit comments

Comments
 (0)