invoices: use longer timeout for HTLC resolution in AMP test
What changed, and why it matters
This commit only changes test code. It makes three timeout waits in an AMP invoice test longer so the test does not flake under slow Postgres test runners. There is no change to production code, no user-facing behavior change, and no security fix.
No security action needed. Treat as a routine test reliability improvement.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff modifies invoices/invoiceregistry_test.go, replacing three time.After(testTimeout) calls with time.After(testTimeoutLong) in testFailPartialAMPPayment. The commit message explains this is to avoid flaky test failures under parallel Postgres test load where sequential DB writes delay the event loop after SetTime fires. No production logic is altered.
Changed components
invoices/invoiceregistry_test.goInspect captured patch +3 / −3
diff --git a/invoices/invoiceregistry_test.go b/invoices/invoiceregistry_test.go
index 5e13f87..785da11 100644
--- a/invoices/invoiceregistry_test.go
+++ b/invoices/invoiceregistry_test.go
@@ -2322,7 +2322,7 @@ func testFailPartialAMPPayment(t *testing.T,
"expected MPPTimeout, got: %v", failRes.Outcome,
)
- case <-time.After(testTimeout):
+ case <-time.After(testTimeoutLong):
t.Fatal("timeout waiting for HTLC resolution")
}
@@ -2339,7 +2339,7 @@ func testFailPartialAMPPayment(t *testing.T,
"expected MPPTimeout, got: %v", failRes.Outcome,
)
- case <-time.After(testTimeout):
+ case <-time.After(testTimeoutLong):
t.Fatal("timeout waiting for HTLC resolution")
}
@@ -2408,7 +2408,7 @@ func testFailPartialAMPPayment(t *testing.T,
"expected MPPTimeout, got: %v", failRes.Outcome,
)
- case <-time.After(testTimeout):
+ case <-time.After(testTimeoutLong):
t.Fatal("timeout waiting for HTLC resolution")
}
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.