tests: restart the node which owns the layer in node bias test
What changed, and why it matters
This commit only fixes a test case so it actually exercises the intended code path. It does not change any production code, so it cannot introduce or fix a real-world security vulnerability by itself. The test change is a reproducer for a startup crash reported elsewhere, but the crash fix is in a separate commit.
No security action required for this commit. Review the separate commit that fixes the startup crash referenced as #9433 for security relevance.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit modifies tests/test_askrene.py in Core Lightning. The test_node_bias_persistence test previously restarted l2, but the askrene layer and node-bias records are stored in l1’s datastore. Therefore the test was comparing l1’s in-memory layer against itself and never reloading from the datastore. The commit changes the restarts to l1 and adds @pytest.mark.xfail(strict=True) so the test becomes a strict reproducer for issue #9433. It is purely a test correction; no runtime code is changed.
Changed components
tests/test_askrene.pyInspect captured patch +3 / −2
### tests/test_askrene.py
@@ -473,6 +473,7 @@ def test_node_bias_rpc(node_factory):
assert listlayers == {"layers": [expect]}
+@pytest.mark.xfail(strict=True)
def test_node_bias_persistence(node_factory):
"""Test node bias persistence."""
# remove xpay, since it creates a layer!
@@ -505,7 +506,7 @@ def test_node_bias_persistence(node_factory):
]
assert l1.rpc.askrene_listlayers("mylayer") == {"layers": [expect]}
# restarting the node we see the same data again
- l2.restart()
+ l1.restart()
assert l1.rpc.askrene_listlayers("mylayer") == {"layers": [expect]}
r = l1.rpc.askrene_bias_node(
@@ -528,7 +529,7 @@ def test_node_bias_persistence(node_factory):
assert l1.rpc.askrene_listlayers("mylayer") == {"layers": [expect]}
# restarting the node we see the same data again
- l2.restart()
+ l1.restart()
assert l1.rpc.askrene_listlayers("mylayer") == {"layers": [expect]}
Why this scored 12/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.