pytest: make global exclusion for "That's weird: Request X took Y msec" under valgrind.
What changed, and why it matters
This is a test-only change that stops CI test failures caused by slow valgrind runs. It does not change the actual Core Lightning node software that users run, so it has no direct security impact on real systems.
No security action required. Treat as normal test infrastructure maintenance.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit modifies the pytest testing framework to globally ignore ‘That’s weird: Request X took Y msec’ log messages when tests run under valgrind on slow machines. Previously individual tests added per-test ‘broken_log’ regex exclusions. The change centralizes this exception in checkBroken() and removes two per-test workarounds. No production code is changed.
Changed components
contrib/pyln-testing/pyln/testing/fixtures.pytests/test_plugin.pytests/test_wallet.pyInspect captured patch +7 / −5
diff --git a/contrib/pyln-testing/pyln/testing/fixtures.py b/contrib/pyln-testing/pyln/testing/fixtures.py
index c5015ed..e04d6d8 100644
--- a/contrib/pyln-testing/pyln/testing/fixtures.py
+++ b/contrib/pyln-testing/pyln/testing/fixtures.py
@@ -1,6 +1,6 @@
from concurrent import futures
from pyln.testing.db import SqliteDbProvider, PostgresDbProvider
-from pyln.testing.utils import NodeFactory, BitcoinD, ElementsD, env, LightningNode, TEST_DEBUG, TEST_NETWORK
+from pyln.testing.utils import NodeFactory, BitcoinD, ElementsD, env, LightningNode, TEST_DEBUG, TEST_NETWORK, SLOW_MACHINE, VALGRIND
from pyln.client import Millisatoshi
from typing import Dict
from pathlib import Path
@@ -635,6 +635,10 @@ def checkBroken(node):
if node.broken_log:
ex = re.compile(node.broken_log)
broken_lines = [l for l in broken_lines if not ex.search(l)]
+ # Valgrind under CI can be really slow, so we get spurious alerts
+ if SLOW_MACHINE and VALGRIND:
+ slowreq = re.compile("That's weird: Request .* took [0-9]* milliseconds")
+ broken_lines = [l for l in broken_lines if not slowreq.search(l)]
if broken_lines:
print(broken_lines)
return 1
diff --git a/tests/test_plugin.py b/tests/test_plugin.py
index d2eeee1..e194952 100644
--- a/tests/test_plugin.py
+++ b/tests/test_plugin.py
@@ -2984,8 +2984,7 @@ def test_plugin_shutdown(node_factory):
def test_commando(node_factory, executor):
l1, l2 = node_factory.line_graph(2, fundchannel=False,
- # Under valgrind, checkrune of 400k command can be slow!
- opts={'log-level': 'io', 'broken_log': "That's weird: Request .* took"})
+ opts={'log-level': 'io'})
rune = l1.rpc.createrune()['rune']
diff --git a/tests/test_wallet.py b/tests/test_wallet.py
index b8eeb99..5be686d 100644
--- a/tests/test_wallet.py
+++ b/tests/test_wallet.py
@@ -1225,8 +1225,7 @@ def test_sign_and_send_psbt(node_factory, bitcoind, chainparams):
@unittest.skipIf(TEST_NETWORK == 'liquid-regtest', "BIP86 random_hsm not compatible with liquid-regtest bech32")
def test_txsend(node_factory, bitcoind, chainparams):
amount = 1000000
- # Under valgrind, we can actually take 5 seconds to sign multiple inputs!
- l1 = node_factory.get_node(random_hsm=True, broken_log="That's weird: Request signpsbt took")
+ l1 = node_factory.get_node(random_hsm=True)
addr = chainparams['example_addr']
# Add some funds to withdraw later
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.