Skip to content

Commit

Permalink
Merge bitcoin#28822: test: Add missing wait for version to be sent in…
Browse files Browse the repository at this point in the history
… add_outbound_p2p_connection

faa2ad8 test: Add missing wait for version to be sent in add_outbound_p2p_connection (MarcoFalke)

Pull request description:

  Can be tested with:

  ```diff
  diff --git a/test/functional/test_framework/p2p.py b/test/functional/test_framework/p2p.py
  index b1ed97b794..eb4f72c6b6 100755
  --- a/test/functional/test_framework/p2p.py
  +++ b/test/functional/test_framework/p2p.py
  @@ -205,6 +205,7 @@ class P2PConnection(asyncio.Protocol):
           assert not self._transport
           logger.debug("Connected & Listening: %s:%d" % (self.dstaddr, self.dstport))
           self._transport = transport
  +        import time;time.sleep(.1);
           if self.on_connection_send_msg:
               self.send_message(self.on_connection_send_msg)
               self.on_connection_send_msg = None  # Never used again
  ```

  Found and reported by mzumsande in bitcoin#28782 (review)

ACKs for top commit:
  mzumsande:
    ACK faa2ad8

Tree-SHA512: 863f06125dec40cccaa852d0d8ca2e2b9c0b74610205e9fd6c9c279bdf36801ff475e3d873fd1b18172eb8220e17b2caff60069ce63512e569934a43f27d03fd
  • Loading branch information
fanquake committed Nov 9, 2023
2 parents d60ebea + faa2ad8 commit c2da8c5
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions test/functional/test_framework/test_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -703,6 +703,7 @@ def addconnection_callback(address, port):
p2p_conn.wait_for_connect()
self.p2ps.append(p2p_conn)

p2p_conn.wait_until(lambda: not p2p_conn.on_connection_send_msg)
if wait_for_verack:
p2p_conn.wait_for_verack()
p2p_conn.sync_with_ping()
Expand Down

0 comments on commit c2da8c5

Please sign in to comment.