diff options
author | stratospher <44024636+stratospher@users.noreply.github.com> | 2024-04-17 13:05:47 +0530 |
---|---|---|
committer | stratospher <44024636+stratospher@users.noreply.github.com> | 2024-04-19 00:33:45 +0530 |
commit | 6b02c11d667adff24daf611f9b14815d27963674 (patch) | |
tree | e61b1c67e1b5d0f0a6ff7de02ba0a79013705c3d | |
parent | c8e3978114716bb8fb10695b9d187652f3ab4926 (diff) | |
download | bitcoin-6b02c11d667adff24daf611f9b14815d27963674.tar.xz |
test: Fix intermittent issue in p2p_handshake.py
If we reuse the same port when disconnecting and establishing connections
again, we might hit this scenario:
- disconnection is done on python side for P2PConnection
- disconnection is not complete on c++ side for TestNode
- we're trying to establish a new connection on same port again
Prevent this scenario from happening by ensuring disconnection on c++
side for TestNode as well.
-rwxr-xr-x | test/functional/p2p_handshake.py | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/test/functional/p2p_handshake.py b/test/functional/p2p_handshake.py index f0b62e291d..dd19fe9333 100755 --- a/test/functional/p2p_handshake.py +++ b/test/functional/p2p_handshake.py @@ -41,6 +41,7 @@ class P2PHandshakeTest(BitcoinTestFramework): peer.sync_with_ping() peer.peer_disconnect() peer.wait_for_disconnect() + self.wait_until(lambda: len(node.getpeerinfo()) == 0) def test_desirable_service_flags(self, node, service_flag_tests, desirable_service_flags, expect_disconnect): """Check that connecting to a peer either fails or succeeds depending on its offered |