HomePhabricator

Tests: speed up fundrawtransaction test

Description

Tests: speed up fundrawtransaction test

Summary:

[tests] Speed up rpc_fundrawtransaction.py

Most of the time in rpc_fundrawtransaction.py is spent waiting for
unconfirmed transactions to propagate. Net processing adds a poisson
random delay to the time it will INV transactions with a mean interval
of 5 seconds.

Instead just generate the block on the node that sent the transaction:

rpc_fundrawtransaction.py is not intended to be a test for transaction
relay, so it's ok to do this.

[tests] Use -whitelist in rpc_fundrawtransaction.py

Makes tx relay faster

[tests] Don't stop-start unnecessarily in rpc_fundrawtransaction.py

This was only added in c1dde3a949b36ce9c2155777b3fa1372e7ed97d8 to match
behaviour when encryptwallet would restart the node. It's not required
for the test (and slows things down).

This is a backport of Core PR17340

Test Plan:

$ ninja && test/functional/test_runner.py rpc_fundrawtransaction
...
rpc_fundrawtransaction.py passed, Duration: 86 s

$ git cherry-pick 646b593bbd0db113c6e45ab92177b8f5251e8710
$ ninja && test/functional/test_runner.py rpc_fundrawtransaction
...
rpc_fundrawtransaction.py passed, Duration: 64 s

$ git cherry-pick 9a8505299ba392acbab4647963113b0c29495f1d
$ ninja && test/functional/test_runner.py rpc_fundrawtransaction
...
rpc_fundrawtransaction.py passed, Duration: 44 s

$ git cherry-pick af7bae734089f6af0029b0887932ccd9a469e12e
$ ninja && test/functional/test_runner.py rpc_fundrawtransaction
...
rpc_fundrawtransaction.py passed, Duration: 42 s

Reviewers: O1 Bitcoin ABC, #bitcoin_abc, majcosta

Reviewed By: O1 Bitcoin ABC, #bitcoin_abc, majcosta

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

Details

Provenance
John Newbery <john@johnnewbery.com>Authored on Nov 4 2020, 19:44
PiRKCommitted on Nov 4 2020, 19:44
abc-botPushed on Nov 4 2020, 19:50
Reviewer
Restricted Owners Package
Differential Revision
D8260: Tests: speed up fundrawtransaction test
Parents
rABC96027f8aeee3: rpc: Remove unused boost::this_thread::interruption_point
Branches
Unknown
Tags
Unknown