Page MenuHomePhabricator

[tests] Fix network threading in functional tests
ClosedPublic

Authored by Fabien on Tue, Jan 22, 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
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Fabien created this revision.Tue, Jan 22, 14:42
Herald added a reviewer: Restricted Project. · View Herald TranscriptTue, Jan 22, 14:42
Herald added a subscriber: schancel. · View Herald Transcript
jasonbcox accepted this revision.Tue, Jan 22, 18:25
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.Tue, Jan 22, 18:25
Closed by commit rABCc983a34d24cf: [tests] Fix network threading in functional tests (authored by John Newbery <john@johnnewbery.com>, committed by Fabien). · Explain WhyTue, Jan 22, 18:43
This revision was automatically updated to reflect the committed changes.