HomePhabricator

Merge #13048: [tests] Fix feature_block flakiness

Description

Merge #13048: [tests] Fix feature_block flakiness

Summary:
PR13048 backport https://github.com/bitcoin/bitcoin/pull/13048/files
c1d742025c [tests] Fix feature_block flakiness (John Newbery)

Pull request description:

feature_block.py occasionally fails on Travis. I believe this is due to
a a race condition when reconnecting to bitcoind after a subtest that
expects disconnection. If the test runs ahead and sends the INV for the
subsequent test before we've received the initial sync getheaders, then
we may end up sending two headers messages - one as a response to the
initial sync getheaders and one in response to the INV getheaders. If
both of those headers fail validation with a DoS score of 50 or higher,
then we'll unexpectedly be disconnected.

There is only one validation failure that has a DoS score bewteen 50 and
100, which is high-hash. That's why the test is failing immediately
after the "Reject a block with invalid work" subtest.

Fix is to wait for the initial getheaders from the peer before we
start populating our blockstore. That way we won't have any invalid
headers to respond to it with.

Depends on D3514

Test Plan: ./test/functional/test_runner.py feature_block.py

Reviewers: deadalnix, Fabien, jasonbcox, #bitcoin_abc

Reviewed By: deadalnix, #bitcoin_abc

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

Details

Provenance
MarcoFalke <falke.marco@gmail.com>Authored on Apr 22 2018, 01:00
Mark Lundeberg <36528214+markblundeberg@users.noreply.github.com>Committed on Jul 3 2019, 14:47
markblundebergPushed on Jul 3 2019, 14:55
Reviewer
Restricted Project
Differential Revision
D3528: Merge #13048: [tests] Fix feature_block flakiness
Parents
rSTAGING2e1d21e29394: Merge #11773: [tests] Change feature_block.py to use BitcoinTestFramework
Branches
Unknown
Tags
Unknown