mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-08-25 20:51:33 +02:00
test: Update wait_until usage in tests not to use the one from utils
Replace "wait_until()" usage from utils, with the ones from BitcoinTestFramework and P2PInterface. closes #19080
This commit is contained in:
@@ -26,7 +26,6 @@ from test_framework.test_framework import BitcoinTestFramework
|
||||
from test_framework.util import (
|
||||
assert_equal,
|
||||
connect_nodes,
|
||||
wait_until,
|
||||
)
|
||||
|
||||
# P2PInterface is a class containing callbacks to be executed when a P2P
|
||||
@@ -203,7 +202,7 @@ class ExampleTest(BitcoinTestFramework):
|
||||
|
||||
# wait_until() will loop until a predicate condition is met. Use it to test properties of the
|
||||
# P2PInterface objects.
|
||||
wait_until(lambda: sorted(blocks) == sorted(list(self.nodes[2].p2p.block_receive_map.keys())), timeout=5, lock=p2p_lock)
|
||||
self.nodes[2].p2p.wait_until(lambda: sorted(blocks) == sorted(list(self.nodes[2].p2p.block_receive_map.keys())), timeout=5)
|
||||
|
||||
self.log.info("Check that each block was received only once")
|
||||
# The network thread uses a global lock on data access to the P2PConnection objects when sending and receiving
|
||||
|
Reference in New Issue
Block a user