HomePhabricator

test: improve robustness of connect_nodes()

Description

test: improve robustness of connect_nodes()

Summary:

The 'connect_nodes' function in the test framework relies
on a stable number of peer connections to verify the new
connection between the nodes is successfully established.
This approach is fragile, as any of the peers involved in
the process can drop, lose, or create a connection at any
step, causing subsequent 'wait_until' checks to stall
indefinitely even when the peers in question are connected
successfully.

This commit improves the situation by using the nodes' subversion
and the connection direction (inbound/outbound) to identify the
exact peer connection and perform the checks exclusively on it.

Backport of core#30118 and core#30252.

Test Plan:

ninja check-functional

Reviewers: #bitcoin_abc, PiRK

Reviewed By: #bitcoin_abc, PiRK

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

Details

Provenance
furszy <matiasfurszyfer@protonmail.com>Authored on May 15 2024, 20:33
FabienCommitted on Tue, Feb 11, 11:10
FabienPushed on Tue, Feb 11, 11:10
Reviewer
Restricted Project
Differential Revision
D17655: test: improve robustness of connect_nodes()
Parents
rABCdb526ab596e1: assumeutxo cleanup: Move IsInitialBlockDownload & NotifyHeaderTip to…
Branches
Unknown
Tags
Unknown