Merge bitcoin/bitcoin#26630: test: Fix intermittent issue in rpc_net.py

fadf7b8fef5ef7111e4634137f8b961b21217cdb test: Fix intermittent issue in rpc_net.py (MarcoFalke)

Pull request description:

  Both nodes must be aware of the closed connections before re-connecting, otherwise the test will fail.

  Fixes #25741

ACKs for top commit:
  jarolrod:
    ACK fadf7b8fef5ef7111e4634137f8b961b21217cdb

Tree-SHA512: 0492dd59a46516007e903fe8f6288982e305d4fd152a0297dd60e10ac663efc9bdc0bc6d1d2c6ec5f239196dac08319f37b079401fe057e4864b117b0fd9dcbc
This commit is contained in:
fanquake 2022-12-04 14:38:57 +00:00
commit fe8d15c907
No known key found for this signature in database
GPG Key ID: 2EEB9F5CC09526C1

View File

@ -185,7 +185,8 @@ class NetTest(BitcoinTestFramework):
self.nodes[0].setnetworkactive(state=False)
assert_equal(self.nodes[0].getnetworkinfo()['networkactive'], False)
# Wait a bit for all sockets to close
self.wait_until(lambda: self.nodes[0].getnetworkinfo()['connections'] == 0, timeout=3)
for n in self.nodes:
self.wait_until(lambda: n.getnetworkinfo()['connections'] == 0, timeout=3)
with self.nodes[0].assert_debug_log(expected_msgs=['SetNetworkActive: true\n']):
self.nodes[0].setnetworkactive(state=True)