Skip to content

Commit 9368fba

Browse files
committed
test: fix flaky test wallet_groups.py
since the SRD coin selection was added, Elements sometimes picks a 1.0 input instead of 0.5 in this test
1 parent 48ca8b0 commit 9368fba

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

test/functional/wallet_groups.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ def run_test(self):
4949

5050
# For each node, send 0.2 coins back to 0;
5151
# - node[1] should pick one 0.5 UTXO and leave the rest
52+
# ELEMENTS: since SRD was added, node[1] sometimes picks a 1.0 UTXO
5253
# - node[2] should pick one (1.0 + 0.5) UTXO group corresponding to a
5354
# given address, and leave the rest
5455
self.log.info("Test sending transactions picks one UTXO group and leaves the rest")
@@ -61,7 +62,12 @@ def run_test(self):
6162
v = [vout["value"] for vout in tx1["vout"] if vout["scriptPubKey"]["type"] != "fee"]
6263
v.sort()
6364
assert_approx(v[0], vexp=0.2, vspan=0.0001)
64-
assert_approx(v[1], vexp=0.3, vspan=0.0001)
65+
# ELEMENTS
66+
try:
67+
assert_approx(v[1], vexp=0.3, vspan=0.0001)
68+
except AssertionError:
69+
assert_approx(v[1], vexp=0.8, vspan=0.0001)
70+
6571

6672
txid2 = self.nodes[2].sendtoaddress(self.nodes[0].getnewaddress(), 0.2)
6773
tx2 = self.nodes[2].getrawtransaction(txid2, True)

0 commit comments

Comments
 (0)