invoices: increase timeout parallel Postgres tests
Increase the test timeout from 10s to 60s to accommodate slow Postgres database setup and migrations when running tests in parallel. This prevents false-positive test failures on slower CI runners.
This commit is contained in:
1 parent
b3e37edfae
commit
6ea99cde42
1 file changed
+5
-1
@@ -100,6 +100,8 @@ const (
|
|||||||
var (
|
var (
|
||||||
testTimeout = 5 * time.Second
|
testTimeout = 5 * time.Second
|
||||||
|
|
||||||
|
testTimeoutLong = time.Minute
|
||||||
|
|
||||||
testTime = time.Date(2018, time.February, 2, 14, 0, 0, 0, time.UTC)
|
testTime = time.Date(2018, time.February, 2, 14, 0, 0, 0, time.UTC)
|
||||||
|
|
||||||
testInvoicePreimage = lntypes.Preimage{1}
|
testInvoicePreimage = lntypes.Preimage{1}
|
||||||
@@ -255,7 +257,9 @@ func timeout() func() {
|
|||||||
|
|
||||||
go func() {
|
go func() {
|
||||||
select {
|
select {
|
||||||
case <-time.After(10 * time.Second):
|
// Use a longer timeout to accommodate slow Postgres database
|
||||||
|
// setup and migrations when running tests in parallel.
|
||||||
|
case <-time.After(testTimeoutLong):
|
||||||
err := pprof.Lookup("goroutine").WriteTo(os.Stdout, 1)
|
err := pprof.Lookup("goroutine").WriteTo(os.Stdout, 1)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(fmt.Sprintf("error writing to std out "+
|
panic(fmt.Sprintf("error writing to std out "+
|
||||||
|
|||||||
Reference in new issue
Block a user