HomePhabricator

Improve the p2p_inv_download test by using a mocked time

Description

Improve the p2p_inv_download test by using a mocked time

Summary:
The test_inv_block from p2p_inv_download.py test case has a few flaws:

  • The name does not reflect the content (it does not test any block inventory)
  • The test relies on some event to occur within some timeout, which is unlikely to fail but is not guaranteed, and in case of failure makes it not obvious what the problem is
  • It takes an absurd amount of time

This diff addresses all these points. It uses mocktime to both improve the robustness and make the test more easy to debug in case a failure occurs. The test duration is reduced by x2 on my machine (from ~120s to ~60s).

Test Plan:

./test/functional/test_runnner.py p2p_inv_download

Reviewers: #bitcoin_abc, PiRK

Reviewed By: #bitcoin_abc, PiRK

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

Details

Provenance
FabienAuthored on Thu, Jul 22, 10:12
FabienPushed on Thu, Jul 22, 20:21
Reviewer
Restricted Project
Differential Revision
D9830: Improve the p2p_inv_download test by using a mocked time
Parents
rABCbc18e393924f: [Automated] Update timing.json
Branches
Unknown
Tags
Unknown