Skip to content

Commit

Permalink
test: speedup wallet_listtransactions by whitelisting peers (immediat…
Browse files Browse the repository at this point in the history
…e tx relay)

By whitelisting the peers via -whitelist, the inventory is transmissioned
immediately rather than on average every 5 seconds, speeding up the test by at
least a factor of two:

before:
$ time ./wallet_listtransactions.py
...
0m40.25s real     0m01.74s user     0m01.70s system

with this PR:
$ time ./wallet_listtransactions.py
...
0m14.93s real     0m01.68s user     0m01.87s system

This commit also moves the wallet_listtransactions tests into the < 30s group.
  • Loading branch information
theStack committed Jul 15, 2021
1 parent a88fa1a commit fb6c6a7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/functional/test_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,6 @@
'p2p_tx_download.py',
'mempool_updatefromblock.py',
'wallet_dump.py --legacy-wallet',
'wallet_listtransactions.py --legacy-wallet',
'wallet_listtransactions.py --descriptors',
'feature_taproot.py --previous_release',
'feature_taproot.py',
'rpc_signer.py',
Expand Down Expand Up @@ -159,6 +157,8 @@
'wallet_createwallet.py --legacy-wallet',
'wallet_createwallet.py --usecli',
'wallet_createwallet.py --descriptors',
'wallet_listtransactions.py --legacy-wallet',
'wallet_listtransactions.py --descriptors',
'wallet_watchonly.py --legacy-wallet',
'wallet_watchonly.py --usecli --legacy-wallet',
'wallet_reorgsrestore.py',
Expand Down
3 changes: 3 additions & 0 deletions test/functional/wallet_listtransactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
class ListTransactionsTest(BitcoinTestFramework):
def set_test_params(self):
self.num_nodes = 2
# This test isn't testing txn relay/timing, so set whitelist on the
# peers for instant txn relay. This speeds up the test run time 2-3x.
self.extra_args = [["-whitelist=noban@127.0.0.1"]] * self.num_nodes

def skip_test_if_missing_module(self):
self.skip_if_no_wallet()
Expand Down

0 comments on commit fb6c6a7

Please sign in to comment.