Page MenuHomePhabricator

Merge #14700: qa: Avoid race in p2p_invalid_block by waiting for the block request
ClosedPublic

Authored by nakihito on Jun 11 2020, 02:07.

Details

Reviewers
majcosta
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
Restricted Project
Commits
rABCaea5b41c25cb: Merge #14700: qa: Avoid race in p2p_invalid_block by waiting for the block…
Summary

fa21568208 qa: Avoid race in p2p_invalid_block by waiting for the block request (MarcoFalke)
6c787d340c tests: Make feature_block pass on centos (MarcoFalke)

Pull request description:

This hopefully fixes #14661, which I believe is caused by a race in `send_blocks_and_test`. By setting `request_block=False` we only effectively check `node.getbestblockhash() != blocks[-1].hash` before returning and checking the debug.log. By setting `request_block=True` (the default) we make sure that we send the block, then sync with a ping before asserting on the debug.log.

Even if this patch doesn't fix the issue, it is good cleanup: There is no reason to not wait for the blocks to be requested, since in all these cases the header gives no indication that the block is consensus invalid. So this patch makes the test also a bit stricter and more useful.

Unrelated to this, I also include a fix that makes the tests pass on latest CentOS.

Tree-SHA512: c7abee3b7dc790a8af6c289159a7751bd962f6fa16c1537e7e21a0a0ef05b9596d1f4eb75319614603c05cb803e021314fa3596508ba443edd03046b25527e0f

Backport of Core PR14700

Test Plan
./test_runner.py feature_block p2p_invalid_block

Event Timeline

Owners added a reviewer: Restricted Owners Package.Jun 11 2020, 02:07

[Bot Message]
One or more PR numbers were detected in the summary.
Links to those PRs have been inserted into the summary for reference.

This revision is now accepted and ready to land.Jun 11 2020, 02:48

Updated test plan.

This revision is now accepted and ready to land.Jun 11 2020, 18:03