scripted-diff: test: Rename send_message to send_without_ping

send_message only drops the bytes in a buffer and a sync is needed to
avoid intermittent test issues. Change the name of the method to make
this more apparent during review.

-BEGIN VERIFY SCRIPT-
 sed -i 's/send_message(/send_without_ping(/g' $( git grep -l 'send_message(' )
-END VERIFY SCRIPT-
This commit is contained in:
MarcoFalke
2025-02-13 16:22:24 +01:00
parent fa4356717d
commit fa9cf38ab6
35 changed files with 145 additions and 145 deletions

View File

@@ -261,7 +261,7 @@ class InvalidMessagesTest(BitcoinTestFramework):
self.log.info("Test {} message of size {} is logged as misbehaving".format(msg_type, size))
with self.nodes[0].assert_debug_log(['Misbehaving', '{} message size = {}'.format(msg_type, size)]):
conn = self.nodes[0].add_p2p_connection(P2PInterface())
conn.send_message(msg)
conn.send_without_ping(msg)
conn.wait_for_disconnect()
self.nodes[0].disconnect_p2ps()
@@ -304,7 +304,7 @@ class InvalidMessagesTest(BitcoinTestFramework):
blockheader.nNonce += 1
blockheader.rehash()
with self.nodes[0].assert_debug_log(['Misbehaving', 'header with invalid proof of work']):
peer.send_message(msg_headers([blockheader]))
peer.send_without_ping(msg_headers([blockheader]))
peer.wait_for_disconnect()
def test_noncontinuous_headers_msg(self):
@@ -323,7 +323,7 @@ class InvalidMessagesTest(BitcoinTestFramework):
# delete arbitrary block header somewhere in the middle to break link
del block_headers[random.randrange(1, len(block_headers)-1)]
with self.nodes[0].assert_debug_log(expected_msgs=MISBEHAVING_NONCONTINUOUS_HEADERS_MSGS):
peer.send_message(msg_headers(block_headers))
peer.send_without_ping(msg_headers(block_headers))
peer.wait_for_disconnect()
self.nodes[0].disconnect_p2ps()
@@ -338,7 +338,7 @@ class InvalidMessagesTest(BitcoinTestFramework):
self.log.info("(a) Send 80 messages, each of maximum valid data size (4MB)")
for _ in range(80):
conn.send_message(msg_at_size)
conn.send_without_ping(msg_at_size)
# Check that, even though the node is being hammered by nonsense from one
# connection, it can still service other peers in a timely way.