Page MenuHomePhabricator

test: disconnect_nodes should warn if nodes were already disconnected
ClosedPublic

Authored by PiRK on May 13 2021, 15:22.

Details

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

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable