HomePhabricator

[avalanche] Fix flaky abc_p2p_getavaaddr.py test

Description

[avalanche] Fix flaky abc_p2p_getavaaddr.py test

Summary:
The getavaaddr_interval_test checks that the getavaaddr messages are accepted by the node by checking for a response. One of the condition to send addresses (and so reply to this request) is that the peer's address to share have a >= 0 availability score. The test currently ensure this by waiting for the peer to receive a poll message but this is not enough: the peer should also respond to the poll so the score is non negative.

This diff changes the test behavior to actually wait for the availability score to be > 0 (and recompute the statistics in the loop instead of only doing it once) so there is no race condition that could cause the test to be flaky.

Test Plan:

./test/functional/test_runner.py abc_p2p_getavaaddr

Reviewers: #bitcoin_abc, PiRK

Reviewed By: #bitcoin_abc, PiRK

Subscribers: PiRK

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

Details

Provenance
FabienAuthored on Thu, Jan 30, 13:37
FabienPushed on Fri, Jan 31, 08:10
Reviewer
Restricted Project
Differential Revision
D17613: [avalanche] Fix flaky abc_p2p_getavaaddr.py test
Parents
rABCfd85bce1ebe4: [avalanche] Eliminate taking unnecessary locks on cs_stakingRewards when…
Branches
Unknown
Tags
Unknown