pyln-testing: pass timeout to BitcoinProxy
What changed, and why it matters
This commit changes a testing helper so that calls to Bitcoin Core during automated tests wait longer before giving up. It is purely a test-infrastructure reliability tweak and does not affect production code, user funds, or network security.
No security action required. Treat as a normal test-framework reliability improvement.
Security signals we found
No strong security signals were identified.
Evidence from the diff
In contrib/pyln-testing/pyln/testing/utils.py, SimpleBitcoinProxy now accepts a configurable timeout (defaulting to pyln.testing.utils.TIMEOUT, currently 60 s or 180 s when SLOW_MACHINE is set) and passes it through to bitcoin.rpc.BitcoinProxy. Previously the underlying library’s 30-second default was used. This only affects Python test fixtures that drive bitcoind during Core Lightning’s test suite.
Changed components
contrib/pyln-testing/pyln/testing/utils.pySimpleBitcoinProxy classCore Lightning Python test frameworkInspect captured patch +4 / −2
diff --git a/contrib/pyln-testing/pyln/testing/utils.py b/contrib/pyln-testing/pyln/testing/utils.py
index c9b02ac6..918b9071 100644
--- a/contrib/pyln-testing/pyln/testing/utils.py
+++ b/contrib/pyln-testing/pyln/testing/utils.py
@@ -366,8 +366,9 @@ class SimpleBitcoinProxy:
throwaway connections. This is easier than to reach into the RPC
library to close, reopen and reauth upon failure.
"""
- def __init__(self, btc_conf_file, *args, **kwargs):
+ def __init__(self, btc_conf_file, timeout=TIMEOUT, *args, **kwargs):
self.__btc_conf_file__ = btc_conf_file
+ self.__timeout__ = timeout
def __getattr__(self, name):
if name.startswith('__') and name.endswith('__'):
@@ -375,7 +376,8 @@ class SimpleBitcoinProxy:
raise AttributeError
# Create a callable to do the actual call
- proxy = BitcoinProxy(btc_conf_file=self.__btc_conf_file__)
+ proxy = BitcoinProxy(btc_conf_file=self.__btc_conf_file__,
+ timeout=self.__timeout__)
def f(*args):
logging.debug("Calling {name} with arguments {args}".format(
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.