Page MenuHomePhabricator

[tests] Fix network threading in functional tests
ClosedPublic

Authored by Fabien on Jan 22 2019, 14:42.

Details

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

Diff Detail

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

Event Timeline

jasonbcox added a subscriber: jasonbcox.
jasonbcox added inline comments.
test/functional/test_framework/mininode.py
480 ↗(On Diff #6814)

Pretty sure this change is already in the previous diff. That shouldn't affect your merging, so this should be ok.

This revision is now accepted and ready to land.Jan 22 2019, 18:25
This revision was automatically updated to reflect the committed changes.