Skip to content

Commit e9b6400

Browse files
author
MarcoFalke
committed
Merge #21411: test: add logging, reduce blocks, move sync_all in wallet_ groups
c62f9bc test: use fewer blocks in wallet_groups and move sync call (Jon Atack) 3a16b5e test: add missing logging to wallet_groups.py (Jon Atack) Pull request description: - add logging (particularly useful as the tests are somewhat slow) - generate 101 blocks instead of 110 - move `sync_all` call into the loop, so fewer blocks are synced on each call, to hopefully see fewer CI timeouts as in https://bitcoinbuilds.org/index.php?ansilog=88eee99e-1727-44ed-b778-3b9c75c33928.log ``` L2742 File "/home/ubuntu/src/test/functional/wallet_groups.py", line 162, in run_test L2743 self.sync_all() test_framework.authproxy.JSONRPCException: 'syncwithvalidationinterfacequeue' RPC took longer than 960.000000 seconds. Consider using larger timeout for calls that take longer to return. (-344) ``` ACKs for top commit: MarcoFalke: cr ACK c62f9bc Tree-SHA512: 711deafcd589cb8196cb207ff882e0f2ab6b70828a6abad91f83f535974cc430a56b9e8a960fd233d31d610932a0d48b49ee681aae564d145a3040288ecda8f8
2 parents 92cf3a2 + c62f9bc commit e9b6400

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

test/functional/wallet_groups.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,9 @@ def skip_test_if_missing_module(self):
2929
self.skip_if_no_wallet()
3030

3131
def run_test(self):
32+
self.log.info("Setting up")
3233
# Mine some coins
33-
self.nodes[0].generate(110)
34+
self.nodes[0].generate(101)
3435

3536
# Get some addresses from the two nodes
3637
addr1 = [self.nodes[1].getnewaddress() for _ in range(3)]
@@ -48,6 +49,7 @@ def run_test(self):
4849
# - node[1] should pick one 0.5 UTXO and leave the rest
4950
# - node[2] should pick one (1.0 + 0.5) UTXO group corresponding to a
5051
# given address, and leave the rest
52+
self.log.info("Test sending transactions picks one UTXO group and leaves the rest")
5153
txid1 = self.nodes[1].sendtoaddress(self.nodes[0].getnewaddress(), 0.2)
5254
tx1 = self.nodes[1].getrawtransaction(txid1, True)
5355
# txid1 should have 1 input and 2 outputs
@@ -70,7 +72,7 @@ def run_test(self):
7072
assert_approx(v[0], vexp=0.2, vspan=0.0001)
7173
assert_approx(v[1], vexp=1.3, vspan=0.0001)
7274

73-
# Test 'avoid partial if warranted, even if disabled'
75+
self.log.info("Test avoiding partial spends if warranted, even if avoidpartialspends is disabled")
7476
self.sync_all()
7577
self.nodes[0].generate(1)
7678
# Nodes 1-2 now have confirmed UTXOs (letters denote destinations):
@@ -104,7 +106,7 @@ def run_test(self):
104106
assert_equal(input_addrs[0], input_addrs[1])
105107
# Node 2 enforces avoidpartialspends so needs no checking here
106108

107-
# Test wallet option maxapsfee with Node 3
109+
self.log.info("Test wallet option maxapsfee")
108110
addr_aps = self.nodes[3].getnewaddress()
109111
self.nodes[0].sendtoaddress(addr_aps, 1.0)
110112
self.nodes[0].sendtoaddress(addr_aps, 1.0)
@@ -131,6 +133,7 @@ def run_test(self):
131133

132134
# Test wallet option maxapsfee with node 4, which sets maxapsfee
133135
# 1 sat higher, crossing the threshold from non-grouped to grouped.
136+
self.log.info("Test wallet option maxapsfee threshold from non-grouped to grouped")
134137
addr_aps3 = self.nodes[4].getnewaddress()
135138
[self.nodes[0].sendtoaddress(addr_aps3, 1.0) for _ in range(5)]
136139
self.nodes[0].generate(1)
@@ -147,8 +150,7 @@ def run_test(self):
147150
self.sync_all()
148151
self.nodes[0].generate(1)
149152

150-
# Fill node2's wallet with 10000 outputs corresponding to the same
151-
# scriptPubKey
153+
self.log.info("Fill a wallet with 10,000 outputs corresponding to the same scriptPubKey")
152154
for _ in range(5):
153155
raw_tx = self.nodes[0].createrawtransaction([{"txid":"0"*64, "vout":0}], [{addr2[0]: 0.05}])
154156
tx = FromHex(CTransaction(), raw_tx)
@@ -158,12 +160,12 @@ def run_test(self):
158160
signed_tx = self.nodes[0].signrawtransactionwithwallet(funded_tx['hex'])
159161
self.nodes[0].sendrawtransaction(signed_tx['hex'])
160162
self.nodes[0].generate(1)
161-
162-
self.sync_all()
163+
self.sync_all()
163164

164165
# Check that we can create a transaction that only requires ~100 of our
165166
# utxos, without pulling in all outputs and creating a transaction that
166167
# is way too big.
168+
self.log.info("Test creating txn that only requires ~100 of our UTXOs without pulling in all outputs")
167169
assert self.nodes[2].sendtoaddress(address=addr2[0], amount=5)
168170

169171

0 commit comments

Comments
 (0)