Skip to content

Commit 16bd283

Browse files
committed
Reapply "test: p2p: check that connecting to ourself leads to disconnect"
This reverts commit 9ec2c53 with a tiny change included (identation of the wait_until call).
1 parent 0dbcd4c commit 16bd283

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

test/functional/p2p_handshake.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
NODE_WITNESS,
1818
)
1919
from test_framework.p2p import P2PInterface
20+
from test_framework.util import p2p_port
2021

2122

2223
# Desirable service flags for outbound non-pruned and pruned peers. Note that
@@ -88,9 +89,11 @@ def run_test(self):
8889
with node.assert_debug_log([f"feeler connection completed"]):
8990
self.add_outbound_connection(node, "feeler", NODE_NONE, wait_for_disconnect=True)
9091

91-
# TODO: re-add test introduced in commit 5d2fb14bafe4e80c0a482d99e5ebde07c477f000
92-
# ("test: p2p: check that connecting to ourself leads to disconnect") once
93-
# the race condition causing issue #30368 is fixed
92+
self.log.info("Check that connecting to ourself leads to immediate disconnect")
93+
with node.assert_debug_log(["connected to self", "disconnecting"]):
94+
node_listen_addr = f"127.0.0.1:{p2p_port(0)}"
95+
node.addconnection(node_listen_addr, "outbound-full-relay", self.options.v2transport)
96+
self.wait_until(lambda: len(node.getpeerinfo()) == 0)
9497

9598

9699
if __name__ == '__main__':

0 commit comments

Comments
 (0)