HomePhabricator

Merge #17121: test: speedup wallet_backup by whitelisting peers (immediate tx…

Description

Merge #17121: test: speedup wallet_backup by whitelisting peers (immediate tx relay)

Summary:
581c9be0d8bff46cd68bd6a3bf72f22d11c09aea test: speedup wallet_backup by whitelisting peers (immediate tx relay) (Sebastian Falbesoner)

Pull request description:

approaches part of #16613 ("Functional test suite bottlenecks")

The majority of the test time is spent in `sync_mempools()` after sending to
addresses, i.e. the bottleneck is in relaying transactions. 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_backup.py
real    2m2.523s
user    0m6.093s
sys 0m2.454s
```
with this PR:
```
$ time ./wallet_backup_with_whitelist.py
real    0m36.570s
user    0m5.365s
sys 0m1.696s
```
Note that the test is not deterministic (the `sendtoaddress` RPC in function
`one_send()` is executed with a probability of 50%), hence the times could vary
between individual runs.

ACKs for top commit:

MarcoFalke:
  ACK 581c9be0d8bff46cd68bd6a3bf72f22d11c09aea, this test is testing the backup behaviour, not the tx relay behaviour
fanquake:
  ACK 581c9be0d8bff46cd68bd6a3bf72f22d11c09aea

Tree-SHA512: d016f39cdb85501e17a74a4c4db5a9f7404baa76fbcc3675a34d3cd7bf03d7a4cb4fd3e5f17cb0597248120bb5ac8b15d3db7663007b76b010902be72954bde0

Backport of Core PR17121

May be related to this flakiness as well: https://build.bitcoinabc.org/viewLog.html?buildId=35712&buildTypeId=BitcoinABCMasterLinux&tab=buildLog&_focus=1865

Test Plan:

test_runner.py wallet_backup

On my machine, runtime goes from ~116s to ~36s

Reviewers: #bitcoin_abc, deadalnix

Reviewed By: #bitcoin_abc, deadalnix

Differential Revision: https://reviews.bitcoinabc.org/D5731

Details

Provenance
fanquake <fanquake@gmail.com>Authored on Oct 13 2019, 15:32
jasonbcoxCommitted on Apr 15 2020, 00:53
jasonbcoxPushed on Apr 15 2020, 00:53
Reviewer
Restricted Project
Differential Revision
D5731: Merge #17121: test: speedup wallet_backup by whitelisting peers (immediate tx relay)
Parents
rABC333d09ffaffd: [release-process] Update Ubuntu PPA instruction
Branches
Unknown
Tags
Unknown