mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-01 16:31:33 +01:00
qa: Move wait_until to util
This commit is contained in:
@@ -128,7 +128,7 @@ class TestNode(NodeConnCB):
|
||||
expect_headers = headers if headers != None else []
|
||||
expect_inv = inv if inv != None else []
|
||||
test_function = lambda: self.block_announced
|
||||
assert(wait_until(test_function, timeout=60))
|
||||
wait_until(test_function, timeout=60, lock=mininode_lock)
|
||||
with mininode_lock:
|
||||
self.block_announced = False
|
||||
|
||||
@@ -155,12 +155,12 @@ class TestNode(NodeConnCB):
|
||||
return
|
||||
|
||||
test_function = lambda: "getdata" in self.last_message and [x.hash for x in self.last_message["getdata"].inv] == hash_list
|
||||
assert(wait_until(test_function, timeout=timeout))
|
||||
wait_until(test_function, timeout=timeout, lock=mininode_lock)
|
||||
return
|
||||
|
||||
def wait_for_block_announcement(self, block_hash, timeout=60):
|
||||
test_function = lambda: self.last_blockhash_announced == block_hash
|
||||
assert(wait_until(test_function, timeout=timeout))
|
||||
wait_until(test_function, timeout=timeout, lock=mininode_lock)
|
||||
return
|
||||
|
||||
def send_header_for_blocks(self, new_blocks):
|
||||
|
||||
Reference in New Issue
Block a user