From 5168af55a9d54be470ab03507d55debfe813baa0 Mon Sep 17 00:00:00 2001 From: yyforyongyu Date: Fri, 27 Oct 2023 16:30:58 +0800 Subject: [PATCH] itest: fix flake in `max_htlc_pathfind` ``` lnd_max_htlcs_test.go:149: Error Trace: /home/runner/work/lnd/lnd/itest/lnd_max_htlcs_test.go:149 /home/runner/work/lnd/lnd/itest/lnd_max_htlcs_test.go:40 /home/runner/work/lnd/lnd/lntest/harness.go:286 /home/runner/work/lnd/lnd/itest/lnd_test.go:136 Error: Not equal: expected: 3 actual : 0 Test: TestLightningNetworkDaemon/tranche01/60-of-134/btcd/max_htlc_pathfind Messages: expected accepted ``` --- itest/lnd_max_htlcs_test.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/itest/lnd_max_htlcs_test.go b/itest/lnd_max_htlcs_test.go index 36a99e1f1..a9bee5ae4 100644 --- a/itest/lnd_max_htlcs_test.go +++ b/itest/lnd_max_htlcs_test.go @@ -122,8 +122,7 @@ func acceptHoldInvoice(ht *lntest.HarnessTest, idx int, sender, invoice := receiver.RPC.AddHoldInvoice(req) invStream := receiver.RPC.SubscribeSingleInvoice(hash[:]) - inv := ht.ReceiveSingleInvoice(invStream) - require.Equal(ht, lnrpc.Invoice_OPEN, inv.State, "expect open") + ht.AssertInvoiceState(invStream, lnrpc.Invoice_OPEN) sendReq := &routerrpc.SendPaymentRequest{ PaymentRequest: invoice.PaymentRequest, @@ -145,9 +144,7 @@ func acceptHoldInvoice(ht *lntest.HarnessTest, idx int, sender, ) require.Len(ht, payment.Htlcs, 1) - inv = ht.ReceiveSingleInvoice(invStream) - require.Equal(ht, lnrpc.Invoice_ACCEPTED, inv.State, - "expected accepted") + ht.AssertInvoiceState(invStream, lnrpc.Invoice_ACCEPTED) return &holdSubscription{ recipient: receiver,