qa: Move wait_until to util
This commit is contained in:
parent
22e301a3d5
commit
08ce33f8e9
11 changed files with 78 additions and 89 deletions
test/functional
|
@ -23,13 +23,13 @@ from test_framework.mininode import (
|
|||
mininode_lock,
|
||||
msg_block,
|
||||
msg_getdata,
|
||||
wait_until,
|
||||
)
|
||||
from test_framework.test_framework import BitcoinTestFramework
|
||||
from test_framework.util import (
|
||||
assert_equal,
|
||||
connect_nodes,
|
||||
p2p_port,
|
||||
wait_until,
|
||||
)
|
||||
|
||||
# NodeConnCB is a class containing callbacks to be executed when a P2P
|
||||
|
@ -209,7 +209,7 @@ class ExampleTest(BitcoinTestFramework):
|
|||
|
||||
# wait_until() will loop until a predicate condition is met. Use it to test properties of the
|
||||
# NodeConnCB objects.
|
||||
assert wait_until(lambda: sorted(blocks) == sorted(list(node2.block_receive_map.keys())), timeout=5)
|
||||
wait_until(lambda: sorted(blocks) == sorted(list(node2.block_receive_map.keys())), timeout=5, lock=mininode_lock)
|
||||
|
||||
self.log.info("Check that each block was received only once")
|
||||
# The network thread uses a global lock on data access to the NodeConn objects when sending and receiving
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue