pytest: fix flake race in test_even_sendcustommsg.
What changed, and why it matters
This is a test-only fix for a flaky automated test. It adds a wait step so the test does not proceed before a background component has finished updating its settings. There is no change to production code and no security issue.
No security action needed. This is a routine test reliability improvement.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit modifies tests/test_misc.py in Core Lightning. The test_even_sendcustommsg test was flaky because after stopping a plugin that allows custom even messages, the test immediately sent a custom message before connectd had processed the updated allow list. The fix adds a wait_for_log call to synchronize on connectd reporting ‘Now allowing 0 custom message types’ before sending the message. No daemon or protocol code is changed.
Changed components
tests/test_misc.pyInspect captured patch +3 / −0
diff --git a/tests/test_misc.py b/tests/test_misc.py
index 0cfdbe21..c95995d8 100644
--- a/tests/test_misc.py
+++ b/tests/test_misc.py
@@ -4675,6 +4675,9 @@ def test_even_sendcustommsg(node_factory):
# It does if we remove the plugin though!
l2.rpc.plugin_stop("allow_even_msgs.py")
+ # Make sure connectd has processed the update!
+ l2.daemon.wait_for_log("connectd: Now allowing 0 custom message types")
+
l1.rpc.sendcustommsg(l2.info['id'], msg)
l2.daemon.wait_for_log(r'\[IN\] {}'.format(msg))
l1.daemon.wait_for_log('Invalid unknown even msg')
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.