File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -80,6 +80,11 @@ def run_test(self):
80
80
def test_buffer (self ):
81
81
self .log .info ("Test message with header split across two buffers is received" )
82
82
conn = self .nodes [0 ].add_p2p_connection (P2PDataStore ())
83
+ # After add_p2p_connection both sides have the verack processed.
84
+ # However the pong from conn in reply to the ping from the node has not
85
+ # been processed and recorded in totalbytesrecv.
86
+ # Flush the pong from conn by sending a ping from conn.
87
+ conn .sync_with_ping (timeout = 1 )
83
88
# Create valid message
84
89
msg = conn .build_message (msg_ping (nonce = 12345 ))
85
90
cut_pos = 12 # Chosen at an arbitrary position within the header
@@ -89,8 +94,6 @@ def test_buffer(self):
89
94
# Wait until node has processed the first half of the message
90
95
self .wait_until (lambda : self .nodes [0 ].getnettotals ()['totalbytesrecv' ] != before )
91
96
middle = self .nodes [0 ].getnettotals ()['totalbytesrecv' ]
92
- # If this assert fails, we've hit an unlikely race
93
- # where the test framework sent a message in between the two halves
94
97
assert_equal (middle , before + cut_pos )
95
98
conn .send_raw_message (msg [cut_pos :])
96
99
conn .sync_with_ping (timeout = 1 )
You can’t perform that action at this time.
0 commit comments