pytest: wait to make sure moves are registered in coinmoves tests.
What changed, and why it matters
This commit only changes a test file to add short waits before checking coin-move records. It is a test reliability fix, not a security patch, and does not change any production code that handles funds, networking, or cryptography.
No security action needed. Treat as a normal test-flake fix.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff adds wait_for() calls in tests/test_coinmoves.py so that check_channel_moves and check_chain_moves wait until the number of recorded moves matches the expected count before asserting. This addresses a race condition in the test suite between asynchronous coin-move recording and test assertions. No production code is modified.
Changed components
tests/test_coinmoves.pyInspect captured patch +2 / −0
diff --git a/tests/test_coinmoves.py b/tests/test_coinmoves.py
index 485361f3..acf1c0d4 100644
--- a/tests/test_coinmoves.py
+++ b/tests/test_coinmoves.py
@@ -37,11 +37,13 @@ def check_moves(moves, expected):
def check_channel_moves(node, expected):
+ wait_for(lambda: len(node.rpc.listchannelmoves()['channelmoves']) == len(expected))
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))
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.