HomePhabricator

[tests] node_network_limited - remove race condition

Description

[tests] node_network_limited - remove race condition

Summary:
node_network_limited had a race condition, since wait_for_block()
doesn't do what you might expect. It only checks the most recent block
received over the P2P interface (perhaps we should rename the method
wait_for_most_recent_block() to avoid future confusion). The test can
fail if the node sends us invs for other blocks, we respond with a
getdata, and the node sends us one of those blocks in the 0.05 second
wait_until loop window.

Fix this by not responding to inv messages with getdata messages.

Partial backport of core PR11867 (commit 2e02984)

Depends on D2367

Test Plan:

./test/functional/test_runner.py node_network_limited.py

Reviewers: #bitcoin_abc, deadalnix

Reviewed By: #bitcoin_abc, deadalnix

Subscribers: teamcity, schancel

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

Details

Provenance
John Newbery <john@johnnewbery.com>Authored on Dec 11 2017, 17:08
FabienCommitted on Jan 22 2019, 18:35
FabienPushed on Jan 22 2019, 21:29
Reviewer
Restricted Project
Differential Revision
D2368: [tests] node_network_limited - remove race condition
Parents
rSTAGING0c21fb351ed2: [tests] define NODE_NETWORK_LIMITED in test framework
Branches
Unknown
Tags
Unknown