diff options
author | Martin Zumsande <mzumsande@gmail.com> | 2022-11-21 18:10:20 -0500 |
---|---|---|
committer | Martin Zumsande <mzumsande@gmail.com> | 2022-11-21 18:10:25 -0500 |
commit | 0f6cd72237b5c819340e524681b5c95f6a81e0c2 (patch) | |
tree | ad2be07b04389a04cab04a98b68a19b787c635aa /test/functional/rpc_net.py | |
parent | 60a00889b02cdb67ac20328af7477ff55ecd8e46 (diff) | |
download | bitcoin-0f6cd72237b5c819340e524681b5c95f6a81e0c2.tar.xz |
test: Fix intermittent failure in rpc_net.py
The wait in disconnect_p2ps checked for subver, which
is unavailable for the peer that didn't send a version msg.
Diffstat (limited to 'test/functional/rpc_net.py')
-rwxr-xr-x | test/functional/rpc_net.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/test/functional/rpc_net.py b/test/functional/rpc_net.py index 65e3c82c87..01334e2d57 100755 --- a/test/functional/rpc_net.py +++ b/test/functional/rpc_net.py @@ -112,7 +112,7 @@ class NetTest(BitcoinTestFramework): no_version_peer_conntime = int(time.time()) self.nodes[0].setmocktime(no_version_peer_conntime) with self.nodes[0].assert_debug_log([f"Added connection peer={no_version_peer_id}"]): - self.nodes[0].add_p2p_connection(P2PInterface(), send_version=False, wait_for_verack=False) + no_version_peer = self.nodes[0].add_p2p_connection(P2PInterface(), send_version=False, wait_for_verack=False) self.nodes[0].setmocktime(0) peer_info = self.nodes[0].getpeerinfo()[no_version_peer_id] peer_info.pop("addr") @@ -153,7 +153,8 @@ class NetTest(BitcoinTestFramework): "version": 0, }, ) - self.nodes[0].disconnect_p2ps() + no_version_peer.peer_disconnect() + self.wait_until(lambda: len(self.nodes[0].getpeerinfo()) == 2) def test_getnettotals(self): self.log.info("Test getnettotals") |