Page MenuHomePhabricator

test: p2p_feefilter improvements (logging, refactoring, speedup)
ClosedPublic

Authored by PiRK on Sep 14 2021, 13:39.

Details

Summary

test: add logging for p2p_feefilter.py

https://github.com/bitcoin/bitcoin/pull/19564/commits/6d941923c318ce9cb2380d3e41ffb760636656a2

test: use wait_until for invs matching in p2p_feefilter.py

additionally:

-> rename function with snake_case (s/allInvsMatch/wait_for_invs_to_match)
-> move it from global namespace to the class FeefilterConn

https://github.com/bitcoin/bitcoin/pull/19564/commits/fe3f0cc44ec6301a86de48cdc3883377932e44eb

test: speedup p2p_feefilter.py by whitelisting peers (immediate tx relay)

Most of the test time is spent in wait_for_invs() 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 significantly:

https://github.com/bitcoin/bitcoin/pull/19564/commits/9e7894357e296dbe0be775e1527654729dbb71b0

This is a backport of core#19564

Test Plan

before:

TEST             | STATUS    | DURATION

p2p_feefilter.py | ✓ Passed  | 29 s

ALL              | ✓ Passed  | 29 s (accumulated)
Runtime: 21 s

after:

TEST             | STATUS    | DURATION

p2p_feefilter.py | ✓ Passed  | 4 s

ALL              | ✓ Passed  | 4 s (accumulated)

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable