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

@@ -124,7 +124,7 @@ class MaxUploadTest(BitcoinTestFramework):
# the test has been running so far).
with self.nodes[0].assert_debug_log(expected_msgs=["historical block serving limit reached, disconnecting peer=0"]):
for _ in range(3):
p2p_conns[0].send_message(getdata_request)
p2p_conns[0].send_without_ping(getdata_request)
p2p_conns[0].wait_for_disconnect()
assert_equal(len(self.nodes[0].getpeerinfo()), 2)
self.log.info("Peer 0 disconnected after downloading old block too many times")
@@ -148,7 +148,7 @@ class MaxUploadTest(BitcoinTestFramework):
# But if p2p_conns[1] tries for an old block, it gets disconnected too.
getdata_request.inv = [CInv(MSG_BLOCK, big_old_block)]
with self.nodes[0].assert_debug_log(expected_msgs=["historical block serving limit reached, disconnecting peer=1"]):
p2p_conns[1].send_message(getdata_request)
p2p_conns[1].send_without_ping(getdata_request)
p2p_conns[1].wait_for_disconnect()
assert_equal(len(self.nodes[0].getpeerinfo()), 1)
@@ -198,7 +198,7 @@ class MaxUploadTest(BitcoinTestFramework):
self.log.info("Peer gets disconnected for a mempool request after limit is reached")
with self.nodes[0].assert_debug_log(expected_msgs=["mempool request with bandwidth limit reached, disconnecting peer=0"]):
peer.send_message(msg_mempool())
peer.send_without_ping(msg_mempool())
peer.wait_for_disconnect()
self.log.info("Test passing an unparsable value to -maxuploadtarget throws an error")