diff options
author | MarcoFalke <falke.marco@gmail.com> | 2017-08-16 18:17:34 +0200 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2017-10-03 18:29:48 +0200 |
commit | 5398f205e3ba1f7542deeba420f9e198bcb635f5 (patch) | |
tree | c6192e754c839184b61de07d113924ef1cf8acf3 /test/functional/test_framework/comptool.py | |
parent | 1d80d1e319b41e5187d5949b3c22c35df182ba3c (diff) | |
download | bitcoin-5398f205e3ba1f7542deeba420f9e198bcb635f5.tar.xz |
qa: Move wait_until to util
Github-Pull: #11068
Rebased-From: 08ce33f8e95efa81b37ddc6b3350462c61bbfd51
Diffstat (limited to 'test/functional/test_framework/comptool.py')
-rwxr-xr-x | test/functional/test_framework/comptool.py | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/test/functional/test_framework/comptool.py b/test/functional/test_framework/comptool.py index 9f062865a3..bfbc0c3b03 100755 --- a/test/functional/test_framework/comptool.py +++ b/test/functional/test_framework/comptool.py @@ -19,7 +19,7 @@ TestNode behaves as follows: from .mininode import * from .blockstore import BlockStore, TxStore -from .util import p2p_port +from .util import p2p_port, wait_until import logging @@ -189,7 +189,7 @@ class TestManager(object): def wait_for_disconnections(self): def disconnected(): return all(node.closed for node in self.test_nodes) - return wait_until(disconnected, timeout=10) + wait_until(disconnected, timeout=10, lock=mininode_lock) def wait_for_verack(self): return all(node.wait_for_verack() for node in self.test_nodes) @@ -197,7 +197,7 @@ class TestManager(object): def wait_for_pings(self, counter): def received_pongs(): return all(node.received_ping_response(counter) for node in self.test_nodes) - return wait_until(received_pongs) + wait_until(received_pongs, lock=mininode_lock) # 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 @@ -210,8 +210,7 @@ class TestManager(object): ) # --> error if not requested - if not wait_until(blocks_requested, attempts=20*num_blocks): - raise AssertionError("Not all nodes requested block") + wait_until(blocks_requested, attempts=20*num_blocks, lock=mininode_lock) # Send getheaders message [ c.cb.send_getheaders() for c in self.connections ] @@ -231,8 +230,7 @@ class TestManager(object): ) # --> error if not requested - if not wait_until(transaction_requested, attempts=20*num_events): - raise AssertionError("Not all nodes requested transaction") + wait_until(transaction_requested, attempts=20*num_events, lock=mininode_lock) # Get the mempool [ c.cb.send_mempool() for c in self.connections ] |