From 8b9ccfe3105f51cbdfc55de7f2b897699a25e4fd Mon Sep 17 00:00:00 2001 From: yyforyongyu Date: Thu, 20 Oct 2022 19:55:19 +0800 Subject: [PATCH] itest: fix test `async_bidirectional_payments` --- itest/lnd_payment_test.go | 21 +++++++++++++++++---- lntest/wait/timeouts_darwin.go | 2 +- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/itest/lnd_payment_test.go b/itest/lnd_payment_test.go index e8986f363..631399326 100644 --- a/itest/lnd_payment_test.go +++ b/itest/lnd_payment_test.go @@ -271,7 +271,7 @@ func runAsyncPayments(ht *lntest.HarnessTest, alice, bob *node.HarnessNode) { settled := make(chan struct{}) defer close(settled) - timeout := wait.AsyncBenchmarkTimeout * 2 + timeout := wait.AsyncBenchmarkTimeout for i := 0; i < numInvoices; i++ { payReq := bobPayReqs[i] go func() { @@ -327,8 +327,21 @@ func testBidirectionalAsyncPayments(ht *lntest.HarnessTest) { // We use new nodes here as the benchmark test creates lots of data // which can be costly to be carried on. - alice := ht.NewNode("Alice", []string{"--pending-commit-interval=3m"}) - bob := ht.NewNode("Bob", []string{"--pending-commit-interval=3m"}) + args := []string{ + // Increase the dust threshold to avoid the payments fail due + // to threshold limit reached. + "--dust-threshold=5000000", + + // Increase the pending commit interval since there are lots of + // commitment dances. + "--pending-commit-interval=5m", + + // Increase the mailbox delivery timeout as there are lots of + // ADDs going on. + "--htlcswitch.mailboxdeliverytimeout=2m", + } + alice := ht.NewNode("Alice", args) + bob := ht.NewNode("Bob", args) ht.EnsureConnected(alice, bob) ht.FundCoins(btcutil.SatoshiPerBitcoin, alice) @@ -375,7 +388,7 @@ func testBidirectionalAsyncPayments(ht *lntest.HarnessTest) { settled := make(chan struct{}) defer close(settled) - timeout := wait.AsyncBenchmarkTimeout * 4 + timeout := wait.AsyncBenchmarkTimeout * 2 send := func(node *node.HarnessNode, payReq string) { req := &routerrpc.SendPaymentRequest{ PaymentRequest: payReq, diff --git a/lntest/wait/timeouts_darwin.go b/lntest/wait/timeouts_darwin.go index f08cd215a..5cfc16bd7 100644 --- a/lntest/wait/timeouts_darwin.go +++ b/lntest/wait/timeouts_darwin.go @@ -25,7 +25,7 @@ const ( // AsyncBenchmarkTimeout is the timeout used when running the async // payments benchmark. This timeout takes considerably longer on darwin // after go1.12 corrected its use of fsync. - AsyncBenchmarkTimeout = time.Minute * 3 + AsyncBenchmarkTimeout = time.Minute * 5 // NodeStartTimeout is the timeout value when waiting for a node to // become fully started.