invoices: increase timeout parallel Postgres tests
What changed, and why it matters
This commit only changes a test file, increasing a timeout from 10 seconds to 60 seconds during automated tests. It is not a security fix and does not affect the production LND software that users run.
No security action needed. Treat as a routine test-infrastructure change.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch modifies invoices/test_utils_test.go, adding a new testTimeoutLong constant (1 minute) and using it in the timeout() helper instead of the hardcoded 10 * time.Second. The change is purely to reduce false-positive test failures caused by slow Postgres setup/migrations on slower CI runners when tests run in parallel. No production code paths, cryptographic logic, network handling, or database behavior are altered.
Changed components
invoices/test_utils_test.goInspect captured patch +5 / −1
diff --git a/invoices/test_utils_test.go b/invoices/test_utils_test.go
index 6062b3b..3ee8e96 100644
--- a/invoices/test_utils_test.go
+++ b/invoices/test_utils_test.go
@@ -100,6 +100,8 @@ const (
var (
testTimeout = 5 * time.Second
+ testTimeoutLong = time.Minute
+
testTime = time.Date(2018, time.February, 2, 14, 0, 0, 0, time.UTC)
testInvoicePreimage = lntypes.Preimage{1}
@@ -255,7 +257,9 @@ func timeout() func() {
go func() {
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)
if err != nil {
panic(fmt.Sprintf("error writing to std out "+
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.