After applying #15363, and configuring without debug, when I run the functional test suite on a 3 GB RAM disk with --jobs=100 --cachedir=/Volumes/RAMDisk/cache --tmpdir=/Volumes/RAMDisk/tmp
:
- CPU usage hovers between 50 and 80% for the first 45 seconds and then drops.
- RAM usage peaks at about 12 GB in the same time period and then drops.
- test suite takes about 120 seconds
The above suggests that the total run time is determined by a handful of slow running tests:
- wallet_backup.py: ~120s~ 58s
- feature_block.py: ~115s~ 85s
- wallet_address_types.py: ~102s~ 48s
- feature_maxuploadtarget.py: 85s
- p2p_segwit.py: ~83s~ 60s
- p2p_tx_download.py: 84s
- mining_getblocktemplate_longpoll.py: 70s
- feature_fee_estimation.py: ~68s~ 41s
Getting the above tests to run in under 60 seconds should therefore cut total run time in half for me. Whether this benefits slower systems depends on the reason for the bottleneck.
A bit more detail about the slow running tests:
wallet_backup.py
“Creating transactions” takes almost a minute. Backup is nearly instant. “More transactions” takes another 50 seconds. The various restores take 22 seconds in total.
The test could be made faster by:
- generating fewer transactions
- put pre-generated the wallets, use extended test suite to verify their contents. However, it’s useful to check that the backup feature actually works for a freshly generated wallet.
- figuring out why 30 transactions are so slow. I tried setting
wait=0.1
for both sync_mempool and sync_blocks but that didn’t help.
Fixed by #17121
feature_block.py
When running this test individually it took only 25 seconds (in contrast to the wallet_backup where running individually didn’t make much difference). The slowest checks are Reject a block with too many P2SH sigops
(7s)
This test could be split (in two). This requires moving some helper code into the test framework, as well as studying the sequence of checks for inter-dependencies.
See #16613 (comment)
wallet_address_types.py
Runs in 58 seconds individually.
This test seems trivial to split. But like wallet_backup.py
it may be worth investigating why a just a few dozen transactions take so long.
Fixed by #17124
feature_maxuploadtarget.py
Runs in 1 minute individually, could perhaps be split in two.
p2p_segwit.py
TODO
p2p_tx_download.py
TODO
mining_getblocktemplate_longpoll.py
TODO
feature_fee_estimation.py
Fixed by #16535