Skip to content

Commit

Permalink
Give wait_for_pings more time
Browse files Browse the repository at this point in the history
Large reorgs as in the p2p-fullblocktest can cause very long long delays
for the ping that we're waiting for. This was not a problem before dashpay#2593,
as before this wait_until was waiting forever.
  • Loading branch information
codablock committed Jan 3, 2019
1 parent 9cff492 commit 44c4cf8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions qa/rpc-tests/test_framework/comptool.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,10 @@ def veracked():
return all(node.verack_received for node in self.test_nodes)
return wait_until(veracked, timeout=10)

def wait_for_pings(self, counter):
def wait_for_pings(self, counter, timeout=float('inf')):
def received_pongs():
return all(node.received_ping_response(counter) for node in self.test_nodes)
return wait_until(received_pongs)
return wait_until(received_pongs, timeout=timeout)

# sync_blocks: Wait for all connections to request the blockhash given
# then send get_headers to find out the tip of each node, and synchronize
Expand All @@ -222,7 +222,7 @@ def blocks_requested():

# Send ping and wait for response -- synchronization hack
[ c.cb.send_ping(self.ping_counter) for c in self.connections ]
self.wait_for_pings(self.ping_counter)
self.wait_for_pings(self.ping_counter, timeout=300)
self.ping_counter += 1

# Analogous to sync_block (see above)
Expand Down Expand Up @@ -358,7 +358,7 @@ def run(self):
else:
[ c.send_message(msg_block(block)) for c in self.connections ]
[ c.cb.send_ping(self.ping_counter) for c in self.connections ]
self.wait_for_pings(self.ping_counter)
self.wait_for_pings(self.ping_counter, timeout=300)
self.ping_counter += 1
if (not self.check_results(tip, outcome)):
raise AssertionError("Test failed at test %d" % test_number)
Expand Down

0 comments on commit 44c4cf8

Please sign in to comment.