Page MenuHomePhabricator

[tests] node_network_limited - remove race condition
ClosedPublic

Authored by Fabien on Jan 21 2019, 16:20.

Details

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

Diff Detail

Repository
rABC Bitcoin ABC
Branch
PR11867_part3
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 4613
Build 7289: Bitcoin ABC Buildbot (legacy)
Build 7288: arc lint + arc unit