HomePhabricator

test: disconnect_nodes should warn if nodes were already disconnected

Description

test: disconnect_nodes should warn if nodes were already disconnected

Summary:

test: warn if nodes not connected before disconnect_nodes

test: remove redundant two-way disconnect_nodes calls

PR description:

There's no harm in calling disconnect_nodes for nodes that weren't connected (in this case it's a no-op). However, detecting this case and logging a warning can help ensure that tests are behaving as expected.

In addition, since disconnect_nodes works bidirectionally, I removed all instances of this pattern:

disconnect_nodes(self.nodes[0], 1)
disconnect_nodes(self.nodes[1], 0)

This is a backport of core#18890

One of the 3 commits is a no-op for our codebase, as it is touching only a segwit related test.

Test Plan: ninja check-functional

Reviewers: #bitcoin_abc, majcosta

Reviewed By: #bitcoin_abc, majcosta

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

Details

Provenance
Danny Lee <robot-visions@protonmail.com>Authored on May 14 2021, 06:22
PiRKCommitted on May 14 2021, 06:22
abc-botPushed on May 14 2021, 06:28
Reviewer
Restricted Project
Differential Revision
D9523: test: disconnect_nodes should warn if nodes were already disconnected
Parents
rABC6197d93261f8: Remove unused boost/thread
Branches
Unknown
Tags
Unknown