From 4df9b2c5f2824b0b601e9f085dfc457c7e6ee353 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Mon, 4 May 2020 11:02:51 +0930 Subject: [PATCH] pytest: fix flake in test_onchain_different_fees() We didn't wait until l2 processed the final state of HTLC #2, so it might not include it when it drops onchain, leading to us only getting 3 (not 4) sendrawtx calls. Signed-off-by: Rusty Russell --- tests/test_closing.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/test_closing.py b/tests/test_closing.py index 5731de5aa..340c9d1ad 100644 --- a/tests/test_closing.py +++ b/tests/test_closing.py @@ -1189,11 +1189,11 @@ def test_onchain_different_fees(node_factory, bitcoind, executor): l2.rpc.dev_ignore_htlcs(id=l1.info['id'], ignore=True) p1 = executor.submit(l1.pay, l2, 1000000000) - l1.daemon.wait_for_log('htlc 0: RCVD_ADD_ACK_COMMIT->SENT_ADD_ACK_REVOCATION') + l2.daemon.wait_for_log('htlc 0: SENT_ADD_ACK_COMMIT->RCVD_ADD_ACK_REVOCATION') l1.set_feerates((16000, 11000, 7500, 3750)) p2 = executor.submit(l1.pay, l2, 900000000) - l1.daemon.wait_for_log('htlc 1: RCVD_ADD_ACK_COMMIT->SENT_ADD_ACK_REVOCATION') + l2.daemon.wait_for_log('htlc 1: SENT_ADD_ACK_COMMIT->RCVD_ADD_ACK_REVOCATION') # Restart with different feerate for second HTLC. l1.set_feerates((5000, 5000, 5000, 3750)) @@ -1201,7 +1201,7 @@ def test_onchain_different_fees(node_factory, bitcoind, executor): l1.daemon.wait_for_log('peer_out WIRE_UPDATE_FEE') p3 = executor.submit(l1.pay, l2, 800000000) - l1.daemon.wait_for_log('htlc 2: RCVD_ADD_ACK_COMMIT->SENT_ADD_ACK_REVOCATION') + l2.daemon.wait_for_log('htlc 2: SENT_ADD_ACK_COMMIT->RCVD_ADD_ACK_REVOCATION') # Drop to chain l1.rpc.dev_fail(l2.info['id'])