From 5361ec75e71d1366e4a28896bbc71ebd8d888936 Mon Sep 17 00:00:00 2001 From: daywalker90 Date: Mon, 14 Sep 2026 16:17:28 +0200 Subject: [PATCH] tests: fix test_htlc_sig_persistence flake Changelog-None --- tests/test_misc.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/test_misc.py b/tests/test_misc.py index a87f956cdbb5..7aa557e4f9c8 100644 --- a/tests/test_misc.py +++ b/tests/test_misc.py @@ -394,7 +394,12 @@ def test_htlc_sig_persistence(node_factory, bitcoind, executor, chainparams): l1.rpc.connect(l2.info['id'], 'localhost', l2.port) l1.fundchannel(l2, 10**6) f = executor.submit(l1.pay, l2, 31337000) - l1.daemon.wait_for_log(r'HTLC out 0 RCVD_ADD_ACK_COMMIT->SENT_ADD_ACK_REVOCATION') + # Wait until the executor thread is blocked in `waitsendpay` before we + # stop: if l1 goes down before that RPC connects, the executor raises + # ConnectionRefusedError instead of the RpcError we expect below. Order + # is not guaranteed, since the thread can be delayed scheduling the RPC. + l1.daemon.wait_for_logs([r'Payment part [0-9]+/[0-9]+/[0-9]+ status', + r'HTLC out 0 RCVD_ADD_ACK_COMMIT->SENT_ADD_ACK_REVOCATION']) l1.stop() # `pay` call is lost