lntest/timeouts: split into darwin and non-darwin timeouts

This commit is contained in:
Conner Fromknecht 2019-03-27 19:00:39 -07:00
parent 6e61ee2710
commit f3f4093ef0
No known key found for this signature in database
GPG Key ID: E7D737B67FA592C7
4 changed files with 58 additions and 22 deletions

@ -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
// Bob. We also create a small helper function to send payments to Bob,
// 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)
if err != nil {
t.Fatalf("unable to create payment stream for alice: %v", err)

@ -24,27 +24,8 @@ import (
"github.com/lightningnetwork/lnd/lnwire"
)
const (
// DefaultCSV is the CSV delay (remotedelay) we will start our test
// 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
)
// DefaultCSV is the CSV delay (remotedelay) we will start our test nodes with.
const DefaultCSV = 4
// NetworkHarness is an integration testing harness for the lightning network.
// The harness by default is created with two active nodes on the network:

27
lntest/timeouts.go Normal file

@ -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
)

28
lntest/timeouts_darwin.go Normal file

@ -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
)