Skip to content

Commit cf88a8a

Browse files
authored
Merge pull request #8828 from yyforyongyu/increase-itest-timeout
lntest: increase timeout for postgres backend
2 parents 26892a2 + 84e58d6 commit cf88a8a

File tree

6 files changed

+28
-12
lines changed

6 files changed

+28
-12
lines changed

.github/workflows/main.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ defaults:
2323
env:
2424
BITCOIN_VERSION: "27"
2525

26-
TRANCHES: 16
26+
TRANCHES: 8
2727

2828
# If you change this value, please change it in the following files as well:
2929
# /.travis.yml

chainntnfs/bitcoindnotify/bitcoind_test.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,9 @@ func syncNotifierWithMiner(t *testing.T, notifier *BitcoindNotifier,
100100
select {
101101
case <-time.After(100 * time.Millisecond):
102102
case <-timeout:
103-
t.Fatalf("timed out waiting to sync notifier")
103+
t.Fatalf("timed out in syncNotifierWithMiner, got "+
104+
"err=%v, minerHeight=%v, bitcoindHeight=%v",
105+
err, minerHeight, bitcoindHeight)
104106
}
105107
}
106108
}

itest/lnd_route_blinding_test.go

+9
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"context"
66
"crypto/sha256"
77
"encoding/hex"
8+
"errors"
89
"time"
910

1011
"github.com/btcsuite/btcd/btcec/v2"
@@ -465,6 +466,14 @@ func (b *blindedForwardTest) sendBlindedPayment(ctx context.Context,
465466
ctx, cancel := context.WithTimeout(ctx, time.Hour)
466467
go func() {
467468
_, err := b.ht.Alice.RPC.Router.SendToRouteV2(ctx, sendReq)
469+
470+
// We may get a context canceled error when the test is
471+
// finished.
472+
if errors.Is(err, context.Canceled) {
473+
b.ht.Logf("sendBlindedPayment: parent context canceled")
474+
return
475+
}
476+
468477
require.NoError(b.ht, err)
469478
}()
470479

lntest/wait/timeouts.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const (
1616

1717
// ChannelCloseTimeout is the max time we will wait before a channel is
1818
// considered closed.
19-
ChannelCloseTimeout = time.Second * 60
19+
ChannelCloseTimeout = time.Second * 30
2020

2121
// DefaultTimeout is a timeout that will be used for various wait
2222
// scenarios where no custom timeout value is defined.

lntest/wait/timeouts_darwin.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const (
1616

1717
// ChannelCloseTimeout is the max time we will wait before a channel is
1818
// considered closed.
19-
ChannelCloseTimeout = time.Second * 60
19+
ChannelCloseTimeout = time.Second * 30
2020

2121
// DefaultTimeout is a timeout that will be used for various wait
2222
// scenarios where no custom timeout value is defined.

lntest/wait/timeouts_remote_db.go

+13-8
Original file line numberDiff line numberDiff line change
@@ -6,34 +6,39 @@ package wait
66
import "time"
77

88
const (
9+
// extraTimeout is the additional time we wait for the postgres backend
10+
// until the issue is resolved:
11+
// - https://github.com/lightningnetwork/lnd/issues/8809
12+
extraTimeout = time.Second * 30
13+
914
// MinerMempoolTimeout is the max time we will wait for a transaction
1015
// to propagate to the mining node's mempool.
11-
MinerMempoolTimeout = time.Minute
16+
MinerMempoolTimeout = time.Minute + extraTimeout
1217

1318
// ChannelOpenTimeout is the max time we will wait before a channel to
1419
// be considered opened.
15-
ChannelOpenTimeout = time.Second * 30
20+
ChannelOpenTimeout = time.Second*30 + extraTimeout
1621

1722
// ChannelCloseTimeout is the max time we will wait before a channel is
1823
// considered closed.
19-
ChannelCloseTimeout = time.Second * 30
24+
ChannelCloseTimeout = time.Second*30 + extraTimeout
2025

2126
// DefaultTimeout is a timeout that will be used for various wait
2227
// scenarios where no custom timeout value is defined.
23-
DefaultTimeout = time.Second * 60
28+
DefaultTimeout = time.Second*60 + extraTimeout
2429

2530
// AsyncBenchmarkTimeout is the timeout used when running the async
2631
// payments benchmark.
27-
AsyncBenchmarkTimeout = time.Minute * 2
32+
AsyncBenchmarkTimeout = time.Minute*2 + extraTimeout
2833

2934
// NodeStartTimeout is the timeout value when waiting for a node to
3035
// become fully started.
31-
NodeStartTimeout = time.Minute * 2
36+
NodeStartTimeout = time.Minute*2 + extraTimeout
3237

3338
// SqliteBusyTimeout is the maximum time that a call to the sqlite db
3439
// will wait for the connection to become available.
35-
SqliteBusyTimeout = time.Second * 10
40+
SqliteBusyTimeout = time.Second*10 + extraTimeout
3641

3742
// PaymentTimeout is the timeout used when sending payments.
38-
PaymentTimeout = time.Second * 60
43+
PaymentTimeout = time.Second*60 + extraTimeout
3944
)

0 commit comments

Comments
 (0)