pytest: print useful information if we don't get our channelmoves/chainmoves
What changed, and why it matters
This commit only improves a test helper so that when a test times out waiting for coin-movement records, it prints extra diagnostic information before failing. It does not change any production code, network behavior, or security logic.
No security action needed; treat as a normal test-maintenance commit.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch modifies tests/test_coinmoves.py to wrap wait_for() calls in try/except ValueError blocks. On timeout, it prints ‘ Didn’t see enough channelmoves’ or ‘ Didn’t see enough chainmoves’, then proceeds to the existing check_moves assertions so the diff is still shown. This is purely a test-debugging quality-of-life change.
Changed components
tests/test_coinmoves.pyInspect captured patch +10 / −2
diff --git a/tests/test_coinmoves.py b/tests/test_coinmoves.py
index 7d86ae6c..21c6ea97 100644
--- a/tests/test_coinmoves.py
+++ b/tests/test_coinmoves.py
@@ -37,13 +37,21 @@ def check_moves(moves, expected):
def check_channel_moves(node, expected):
- wait_for(lambda: len(node.rpc.listchannelmoves()['channelmoves']) == len(expected))
+ # If this times out, show the result anyway.
+ try:
+ wait_for(lambda: len(node.rpc.listchannelmoves()['channelmoves']) == len(expected))
+ except ValueError:
+ print("*** Didn't see enough channelmoves")
check_moves(node.rpc.listchannelmoves()['channelmoves'], expected)
check_sql(node, "channelmoves", expected)
def check_chain_moves(node, expected):
- wait_for(lambda: len(node.rpc.listchainmoves()['chainmoves']) == len(expected))
+ # If this times out, show the result anyway.
+ try:
+ wait_for(lambda: len(node.rpc.listchainmoves()['chainmoves']) == len(expected))
+ except ValueError:
+ print("*** Didn't see enough chainmoves")
check_moves(node.rpc.listchainmoves()['chainmoves'], expected)
check_sql(node, "chainmoves", expected)
# Check extra_tags.
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.