lntest/timeouts: split into darwin and non-darwin timeouts
This commit is contained in:
4 files changed
+58
-22
No files matched your search
+1
-1
@@ -8887,7 +8887,7 @@ func testAsyncPayments(net *lntest.NetworkHarness, t *harnessTest) {
|
|||||||
// Open up a payment stream to Alice that we'll use to send payment to
|
// Open up a payment stream to Alice that we'll use to send payment to
|
||||||
// Bob. We also create a small helper function to send payments to Bob,
|
// Bob. We also create a small helper function to send payments to Bob,
|
||||||
// consuming the payment hashes we generated above.
|
// consuming the payment hashes we generated above.
|
||||||
ctxt, _ = context.WithTimeout(ctxb, time.Minute)
|
ctxt, _ = context.WithTimeout(ctxb, lntest.AsyncBenchmarkTimeout)
|
||||||
alicePayStream, err := net.Alice.SendPayment(ctxt)
|
alicePayStream, err := net.Alice.SendPayment(ctxt)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("unable to create payment stream for alice: %v", err)
|
t.Fatalf("unable to create payment stream for alice: %v", err)
|
||||||
|
|||||||
+2
-21
@@ -24,27 +24,8 @@ import (
|
|||||||
"github.com/lightningnetwork/lnd/lnwire"
|
"github.com/lightningnetwork/lnd/lnwire"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
// DefaultCSV is the CSV delay (remotedelay) we will start our test nodes with.
|
||||||
// DefaultCSV is the CSV delay (remotedelay) we will start our test
|
const DefaultCSV = 4
|
||||||
// nodes with.
|
|
||||||
DefaultCSV = 4
|
|
||||||
|
|
||||||
// MinerMempoolTimeout is the max time we will wait for a transaction
|
|
||||||
// to propagate to the mining node's mempool.
|
|
||||||
MinerMempoolTimeout = time.Second * 30
|
|
||||||
|
|
||||||
// ChannelOpenTimeout is the max time we will wait before a channel to
|
|
||||||
// be considered opened.
|
|
||||||
ChannelOpenTimeout = time.Second * 30
|
|
||||||
|
|
||||||
// ChannelCloseTimeout is the max time we will wait before a channel is
|
|
||||||
// considered closed.
|
|
||||||
ChannelCloseTimeout = time.Second * 30
|
|
||||||
|
|
||||||
// DefaultTimeout is a timeout that will be used for various wait
|
|
||||||
// scenarios where no custom timeout value is defined.
|
|
||||||
DefaultTimeout = time.Second * 30
|
|
||||||
)
|
|
||||||
|
|
||||||
// NetworkHarness is an integration testing harness for the lightning network.
|
// NetworkHarness is an integration testing harness for the lightning network.
|
||||||
// The harness by default is created with two active nodes on the network:
|
// The harness by default is created with two active nodes on the network:
|
||||||
|
|||||||
@@ -0,0 +1,27 @@
|
|||||||
|
// +build !darwin
|
||||||
|
|
||||||
|
package lntest
|
||||||
|
|
||||||
|
import "time"
|
||||||
|
|
||||||
|
const (
|
||||||
|
// MinerMempoolTimeout is the max time we will wait for a transaction
|
||||||
|
// to propagate to the mining node's mempool.
|
||||||
|
MinerMempoolTimeout = time.Second * 30
|
||||||
|
|
||||||
|
// ChannelOpenTimeout is the max time we will wait before a channel to
|
||||||
|
// be considered opened.
|
||||||
|
ChannelOpenTimeout = time.Second * 30
|
||||||
|
|
||||||
|
// ChannelCloseTimeout is the max time we will wait before a channel is
|
||||||
|
// considered closed.
|
||||||
|
ChannelCloseTimeout = time.Second * 30
|
||||||
|
|
||||||
|
// DefaultTimeout is a timeout that will be used for various wait
|
||||||
|
// scenarios where no custom timeout value is defined.
|
||||||
|
DefaultTimeout = time.Second * 30
|
||||||
|
|
||||||
|
// AsyncBenchmarkTimeout is the timeout used when running the async
|
||||||
|
// payments benchmark.
|
||||||
|
AsyncBenchmarkTimeout = time.Minute
|
||||||
|
)
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
// +build darwin
|
||||||
|
|
||||||
|
package lntest
|
||||||
|
|
||||||
|
import "time"
|
||||||
|
|
||||||
|
const (
|
||||||
|
// MinerMempoolTimeout is the max time we will wait for a transaction
|
||||||
|
// to propagate to the mining node's mempool.
|
||||||
|
MinerMempoolTimeout = time.Second * 30
|
||||||
|
|
||||||
|
// ChannelOpenTimeout is the max time we will wait before a channel to
|
||||||
|
// be considered opened.
|
||||||
|
ChannelOpenTimeout = time.Second * 30
|
||||||
|
|
||||||
|
// ChannelCloseTimeout is the max time we will wait before a channel is
|
||||||
|
// considered closed.
|
||||||
|
ChannelCloseTimeout = time.Second * 30
|
||||||
|
|
||||||
|
// DefaultTimeout is a timeout that will be used for various wait
|
||||||
|
// scenarios where no custom timeout value is defined.
|
||||||
|
DefaultTimeout = time.Second * 30
|
||||||
|
|
||||||
|
// 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
|
||||||
|
)
|
||||||
Reference in new issue
Block a user