pyln-testing: don't assume we're doing debug logging for fundwallet and line_graph helpers.
What changed, and why it matters
This is a small test-framework cleanup. Two helper functions in the Python testing utilities used to wait for certain events by scanning daemon debug logs. The change makes them check the actual RPC/API state instead, so the helpers still work when debug logging is disabled (e.g., when running benchmarks at log level 'info'). There is no change to production node code, no security fix, and no vulnerability.
No security action needed. Treat as a normal testing/maintenance change.
Security signals we found
No strong security signals were identified.
Evidence from the diff
In contrib/pyln-testing/pyln/testing/utils.py, the fundwallet helper no longer waits for a debug log line ‘Owning output .* txid {} CONFIRMED’; it now polls listtransactions() until the txid appears. Similarly, line_graph’s peer-connection wait no longer waits for a connectd debug log line; it polls listpeers() until the peer is present on both sides. This decouples test helpers from debug-log output, allowing tests to run with less verbose logging. The patch is purely in testing infrastructure.
Changed components
contrib/pyln-testing/pyln/testing/utils.pypyln-testing test helpers: fundwallet, line_graphInspect captured patch +3 / −2
diff --git a/contrib/pyln-testing/pyln/testing/utils.py b/contrib/pyln-testing/pyln/testing/utils.py
index b47da3e8..59ebd525 100644
--- a/contrib/pyln-testing/pyln/testing/utils.py
+++ b/contrib/pyln-testing/pyln/testing/utils.py
@@ -1027,7 +1027,7 @@ class LightningNode(object):
addr = self.rpc.newaddr(addrtype)[addrtype]
if mine_block:
txid = self.bitcoin.send_and_mine_block(addr, sats)
- self.daemon.wait_for_log('Owning output .* txid {} CONFIRMED'.format(txid))
+ wait_for(lambda: any([t['hash'] == txid for t in self.rpc.listtransactions()['transactions']]))
else:
txid = self.bitcoin.rpc.sendtoaddress(addr, sats / 10**8)
@@ -1778,7 +1778,8 @@ class NodeFactory(object):
# getpeers.
if not fundchannel:
for src, dst in connections:
- dst.daemon.wait_for_log(r'{}-connectd: Handed peer, entering loop'.format(src.info['id']))
+ wait_for(lambda: src.rpc.listpeers(dst.info['id'])['peers'] != [])
+ wait_for(lambda: dst.rpc.listpeers(src.info['id'])['peers'] != [])
return
bitcoind = nodes[0].bitcoin
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.