HomePhabricator

Fix the avalanche tests

Description

Fix the avalanche tests

Summary:
On slow runs (slow machine, debug, sanitizers, ...) the fork_node has
not enough time to sync the blocks:

  • After the initial 100 blocks creation, the node will invalidate

blocks starting at height 76, generate a new chain then reconsider. If
the fork_node has not synced to the 100th block before the
invalidation, it will not have enough pow to get the avapoll message to
be sent at the end of the test. When the fork_node invalidates the
block 100, it should select this previous 100th block as the new tip.
Not doing so will make the fork_node last generated block reach height
101 instead of 102, and not have enough work to make it a new tip
candidate hence the poll message not sent.

  • The second sync is just to give some time for the fork_node to

catch up, avoiding the assertion to fail spuriously.

Depends on D5693 for the test plan to succeed.

Test Plan:

ninja

for i in {1..100}; do
  if ! ./test/functional/test_runner.py abc-p2p-avalanche then
    break
  fi
done

Reviewers: #bitcoin_abc, deadalnix

Reviewed By: #bitcoin_abc, deadalnix

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

Details

Provenance
FabienAuthored on Apr 9 2020, 03:16
FabienPushed on Apr 10 2020, 15:52
Reviewer
Restricted Project
Differential Revision
D5694: Fix the avalanche tests
Parents
rABCac5ef32c5529: [Avalanche] Gather INVs before entering critical section for cs_vNodes
Branches
Unknown
Tags
Unknown