@@ -62,7 +62,7 @@ class TestNode():
62
62
To make things easier for the test writer, any unrecognised messages will
63
63
be dispatched to the RPC connection."""
64
64
65
- def __init__ (self , i , datadir , * , chain , rpchost , timewait , factor , bitcoind , bitcoin_cli , coverage_dir , cwd , extra_conf = None , extra_args = None , use_cli = False , start_perf = False , use_valgrind = False , version = None , descriptors = False ):
65
+ def __init__ (self , i , datadir , * , chain , rpchost , timewait , timeout_factor , bitcoind , bitcoin_cli , coverage_dir , cwd , extra_conf = None , extra_args = None , use_cli = False , start_perf = False , use_valgrind = False , version = None , descriptors = False ):
66
66
"""
67
67
Kwargs:
68
68
start_perf (bool): If True, begin profiling the node with `perf` as soon as
@@ -128,7 +128,7 @@ def __init__(self, i, datadir, *, chain, rpchost, timewait, factor, bitcoind, bi
128
128
self .perf_subprocesses = {}
129
129
130
130
self .p2ps = []
131
- self .factor = factor
131
+ self .timeout_factor = timeout_factor
132
132
133
133
AddressKeyPair = collections .namedtuple ('AddressKeyPair' , ['address' , 'key' ])
134
134
PRIV_KEYS = [
@@ -241,7 +241,7 @@ def wait_for_rpc_connection(self):
241
241
# The wait is done here to make tests as robust as possible
242
242
# and prevent racy tests and intermittent failures as much
243
243
# as possible. Some tests might not need this, but the
244
- # overhead is trivial, and the added gurantees are worth
244
+ # overhead is trivial, and the added guarantees are worth
245
245
# the minimal performance cost.
246
246
self .log .debug ("RPC successfully started" )
247
247
if self .use_cli :
@@ -349,13 +349,13 @@ def is_node_stopped(self):
349
349
return True
350
350
351
351
def wait_until_stopped (self , timeout = BITCOIND_PROC_WAIT_TIMEOUT ):
352
- wait_until (self .is_node_stopped , timeout = timeout , factor = self .factor )
352
+ wait_until (self .is_node_stopped , timeout = timeout , timeout_factor = self .timeout_factor )
353
353
354
354
@contextlib .contextmanager
355
355
def assert_debug_log (self , expected_msgs , unexpected_msgs = None , timeout = 2 ):
356
356
if unexpected_msgs is None :
357
357
unexpected_msgs = []
358
- time_end = time .time () + timeout * self .factor
358
+ time_end = time .time () + timeout * self .timeout_factor
359
359
debug_log = os .path .join (self .datadir , self .chain , 'debug.log' )
360
360
with open (debug_log , encoding = 'utf-8' ) as dl :
361
361
dl .seek (0 , 2 )
@@ -512,7 +512,7 @@ def add_p2p_connection(self, p2p_conn, *, wait_for_verack=True, **kwargs):
512
512
if 'dstaddr' not in kwargs :
513
513
kwargs ['dstaddr' ] = '127.0.0.1'
514
514
515
- p2p_conn .peer_connect (** kwargs , net = self .chain , factor = self .factor )()
515
+ p2p_conn .peer_connect (** kwargs , net = self .chain , timeout_factor = self .timeout_factor )()
516
516
self .p2ps .append (p2p_conn )
517
517
if wait_for_verack :
518
518
# Wait for the node to send us the version and verack
@@ -526,7 +526,7 @@ def add_p2p_connection(self, p2p_conn, *, wait_for_verack=True, **kwargs):
526
526
# transaction that will be added to the mempool as soon as we return here.
527
527
#
528
528
# So syncing here is redundant when we only want to send a message, but the cost is low (a few milliseconds)
529
- # in comparision to the upside of making tests less fragile and unexpected intermittent errors less likely.
529
+ # in comparison to the upside of making tests less fragile and unexpected intermittent errors less likely.
530
530
p2p_conn .sync_with_ping ()
531
531
532
532
return p2p_conn
0 commit comments