Skip to content

Commit

Permalink
Merge pull request #8828 from yyforyongyu/increase-itest-timeout
Browse files Browse the repository at this point in the history
lntest: increase timeout for postgres backend
  • Loading branch information
yyforyongyu committed Jun 13, 2024
2 parents 26892a2 + 84e58d6 commit cf88a8a
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ defaults:
env:
BITCOIN_VERSION: "27"

TRANCHES: 16
TRANCHES: 8

# If you change this value, please change it in the following files as well:
# /.travis.yml
Expand Down
4 changes: 3 additions & 1 deletion chainntnfs/bitcoindnotify/bitcoind_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,9 @@ func syncNotifierWithMiner(t *testing.T, notifier *BitcoindNotifier,
select {
case <-time.After(100 * time.Millisecond):
case <-timeout:
t.Fatalf("timed out waiting to sync notifier")
t.Fatalf("timed out in syncNotifierWithMiner, got "+
"err=%v, minerHeight=%v, bitcoindHeight=%v",
err, minerHeight, bitcoindHeight)
}
}
}
Expand Down
9 changes: 9 additions & 0 deletions itest/lnd_route_blinding_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"context"
"crypto/sha256"
"encoding/hex"
"errors"
"time"

"github.com/btcsuite/btcd/btcec/v2"
Expand Down Expand Up @@ -465,6 +466,14 @@ func (b *blindedForwardTest) sendBlindedPayment(ctx context.Context,
ctx, cancel := context.WithTimeout(ctx, time.Hour)
go func() {
_, err := b.ht.Alice.RPC.Router.SendToRouteV2(ctx, sendReq)

// We may get a context canceled error when the test is
// finished.
if errors.Is(err, context.Canceled) {
b.ht.Logf("sendBlindedPayment: parent context canceled")
return
}

require.NoError(b.ht, err)
}()

Expand Down
2 changes: 1 addition & 1 deletion lntest/wait/timeouts.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const (

// ChannelCloseTimeout is the max time we will wait before a channel is
// considered closed.
ChannelCloseTimeout = time.Second * 60
ChannelCloseTimeout = time.Second * 30

// DefaultTimeout is a timeout that will be used for various wait
// scenarios where no custom timeout value is defined.
Expand Down
2 changes: 1 addition & 1 deletion lntest/wait/timeouts_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const (

// ChannelCloseTimeout is the max time we will wait before a channel is
// considered closed.
ChannelCloseTimeout = time.Second * 60
ChannelCloseTimeout = time.Second * 30

// DefaultTimeout is a timeout that will be used for various wait
// scenarios where no custom timeout value is defined.
Expand Down
21 changes: 13 additions & 8 deletions lntest/wait/timeouts_remote_db.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,34 +6,39 @@ package wait
import "time"

const (
// extraTimeout is the additional time we wait for the postgres backend
// until the issue is resolved:
// - https://github.com/lightningnetwork/lnd/issues/8809
extraTimeout = time.Second * 30

// MinerMempoolTimeout is the max time we will wait for a transaction
// to propagate to the mining node's mempool.
MinerMempoolTimeout = time.Minute
MinerMempoolTimeout = time.Minute + extraTimeout

// ChannelOpenTimeout is the max time we will wait before a channel to
// be considered opened.
ChannelOpenTimeout = time.Second * 30
ChannelOpenTimeout = time.Second*30 + extraTimeout

// ChannelCloseTimeout is the max time we will wait before a channel is
// considered closed.
ChannelCloseTimeout = time.Second * 30
ChannelCloseTimeout = time.Second*30 + extraTimeout

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

// AsyncBenchmarkTimeout is the timeout used when running the async
// payments benchmark.
AsyncBenchmarkTimeout = time.Minute * 2
AsyncBenchmarkTimeout = time.Minute*2 + extraTimeout

// NodeStartTimeout is the timeout value when waiting for a node to
// become fully started.
NodeStartTimeout = time.Minute * 2
NodeStartTimeout = time.Minute*2 + extraTimeout

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

// PaymentTimeout is the timeout used when sending payments.
PaymentTimeout = time.Second * 60
PaymentTimeout = time.Second*60 + extraTimeout
)

0 comments on commit cf88a8a

Please sign in to comment.