From 73574d919d9c141f36b4d64fd19cf0d43cb3ad88 Mon Sep 17 00:00:00 2001 From: yyforyongyu Date: Wed, 4 Dec 2024 13:44:32 +0800 Subject: [PATCH] lntest: add timeouts for windows For Windows the tests run much slower so we create customized timeouts for them. --- lntest/wait/timeouts.go | 4 ++-- lntest/wait/timeouts_windows.go | 39 +++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 2 deletions(-) create mode 100644 lntest/wait/timeouts_windows.go diff --git a/lntest/wait/timeouts.go b/lntest/wait/timeouts.go index f8239799b..312c788c4 100644 --- a/lntest/wait/timeouts.go +++ b/lntest/wait/timeouts.go @@ -1,5 +1,5 @@ -//go:build !darwin && !kvdb_etcd && !kvdb_postgres -// +build !darwin,!kvdb_etcd,!kvdb_postgres +//go:build !darwin && !windows && !kvdb_etcd && !kvdb_postgres +// +build !darwin,!windows,!kvdb_etcd,!kvdb_postgres package wait diff --git a/lntest/wait/timeouts_windows.go b/lntest/wait/timeouts_windows.go new file mode 100644 index 000000000..4fba516f1 --- /dev/null +++ b/lntest/wait/timeouts_windows.go @@ -0,0 +1,39 @@ +//go:build windows && !kvdb_etcd && !kvdb_postgres +// +build windows,!kvdb_etcd,!kvdb_postgres + +package wait + +import "time" + +const ( + // MinerMempoolTimeout is the max time we will wait for a transaction + // to propagate to the mining node's mempool. + MinerMempoolTimeout = time.Minute + + // 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 * 60 + + // AsyncBenchmarkTimeout is the timeout used when running the async + // payments benchmark. + AsyncBenchmarkTimeout = time.Minute * 5 + + // NodeStartTimeout is the timeout value when waiting for a node to + // become fully started. + NodeStartTimeout = time.Minute * 3 + + // SqliteBusyTimeout is the maximum time that a call to the sqlite db + // will wait for the connection to become available. + SqliteBusyTimeout = time.Second * 10 + + // PaymentTimeout is the timeout used when sending payments. + PaymentTimeout = time.Second * 120 +)