Skip to content

Commit 228b974

Browse files
authored
tests: fix flaky tests that fail due to type strictness (#3010)
1 parent 9c47140 commit 228b974

2 files changed

Lines changed: 4 additions & 5 deletions

File tree

test/functional/feature_any_accounts_to_accounts.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,12 +122,11 @@ def run_test(self):
122122
self.nodes[0].generate(1)
123123

124124
for token in tokens:
125+
token_bal = minterAccountBalances[token["tokenId"]]
125126
if i == wallet1_accs_count - 1: # last account
126-
amount = minterAccountBalances[token["tokenId"]]
127+
amount = token_bal
127128
else:
128-
amount = random.randint(
129-
0, minterAccountBalances[token["tokenId"]] // 2
130-
)
129+
amount = random.randint(0, int(token_bal // 2))
131130

132131
if amount == 0:
133132
continue

test/functional/feature_poolswap_mechanism.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ def poolswap(self, nodes):
206206
self.nodes[0].generate(1)
207207
self.sync_blocks(nodes)
208208

209-
amount = random.randint(1, (self.AMOUNT_TOKEN / 2) // 2)
209+
amount = random.randint(1, int((self.AMOUNT_TOKEN / 2) // 2))
210210
amountsB = {}
211211
reserveA = self.nodes[0].getpoolpair(pool, True)[idPool]["reserveA"]
212212
reserveB = self.nodes[0].getpoolpair(pool, True)[idPool]["reserveB"]

0 commit comments

Comments
 (0)