Skip to content

Commit f7db144

Browse files
whitslackrustyrussell
authored andcommitted
pyln-testing: pass timeout to BitcoinProxy
The bitcoin.rpc.DEFAULT_HTTP_TIMEOUT of 30 seconds may not be enough time to generate a block when the test machine is under load. Pass pyln.testing.utils.TIMEOUT to bitcoin.rpc.RawProxy to allow extra time: currently 60 seconds by default or 180 seconds if SLOW_MACHINE is set. Changelog-None
1 parent 5b06e65 commit f7db144

File tree

1 file changed

+4
-2
lines changed
  • contrib/pyln-testing/pyln/testing

1 file changed

+4
-2
lines changed

contrib/pyln-testing/pyln/testing/utils.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -366,16 +366,18 @@ class SimpleBitcoinProxy:
366366
throwaway connections. This is easier than to reach into the RPC
367367
library to close, reopen and reauth upon failure.
368368
"""
369-
def __init__(self, btc_conf_file, *args, **kwargs):
369+
def __init__(self, btc_conf_file, timeout=TIMEOUT, *args, **kwargs):
370370
self.__btc_conf_file__ = btc_conf_file
371+
self.__timeout__ = timeout
371372

372373
def __getattr__(self, name):
373374
if name.startswith('__') and name.endswith('__'):
374375
# Python internal stuff
375376
raise AttributeError
376377

377378
# Create a callable to do the actual call
378-
proxy = BitcoinProxy(btc_conf_file=self.__btc_conf_file__)
379+
proxy = BitcoinProxy(btc_conf_file=self.__btc_conf_file__,
380+
timeout=self.__timeout__)
379381

380382
def f(*args):
381383
logging.debug("Calling {name} with arguments {args}".format(

0 commit comments

Comments
 (0)