HomePhabricator

[tests] Fix network threading in functional tests

Description

[tests] Fix network threading in functional tests

Summary:
assumevalid.py, example_test.py, p2p-acceptblocks.py and
abc-p2p-compactblocks add p2p_connections after the
NetworkThread has been started. This isn't permitted.
Fix test to restart the network thread when adding new connections.

Add assertions to ensure new tests won't fail into this issue.

p2p-leaktest.py had a potential race condition if the NetworkThread
hadn't terminated by the time we tried to restart it.

Partial backport of core PR11849
commits 5c8ff26 and 34e08b3

Depends on D2383

Test Plan:

./test/functional/test_runner.py --extended

Reviewers: #bitcoin_abc, deadalnix, jasonbcox

Reviewed By: #bitcoin_abc, jasonbcox

Subscribers: jasonbcox, teamcity, schancel

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

Details

Provenance
John Newbery <john@johnnewbery.com>Authored on Dec 7 2017, 18:40
FabienCommitted on Jan 22 2019, 18:43
FabienPushed on Jan 22 2019, 18:43
Reviewer
Restricted Project
Differential Revision
D2384: [tests] Fix network threading in functional tests
Parents
rABC7207f37655b0: [tests] Add network_thread_ functions and use them in tests
Branches
Unknown
Tags
Unknown