itest: deflake outbound remote signer macaroon test
What changed, and why it matters
This commit only changes an integration test. It replaces hard-coded 15-second waits with longer default timeouts so the test doesn't randomly fail on slow CI machines. There is no change to production code or user-facing behavior, and no security issue is being fixed or introduced.
No security action needed. Treat as a normal test-stability improvement.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch modifies itest/lnd_remote_signer_test.go in the testOutboundRSMacaroonEnforcement function. It increases the remote signer connection timeout and the macaroon-read timeout from 15 seconds to wait.DefaultTimeout. The stated purpose is to reduce test flakiness on slow CI runners, especially those using remote database backends. No production logic is altered.
Changed components
itest/lnd_remote_signer_test.goInspect captured patch +11 / −3
### itest/lnd_remote_signer_test.go
@@ -725,12 +725,18 @@ func testOutboundRSMacaroonEnforcement(ht *lntest.HarnessTest) {
remoteSignerHost := fmt.Sprintf(
"localhost:%d", port.NextAvailablePort(),
)
+
+ // The watch-only node starts waiting for the signer to connect after it
+ // has written its macaroons. Before the signer connects, this test
+ // still has to open a stream with the invoice macaroon and start the
+ // signer node, which can take a while on slow CI runners and remote
+ // database backends. Give the signer the default timeout to connect.
watchOnlyArgs := []string{
"--remotesigner.enable",
"--remotesigner.experimentalallowinboundconnection",
fmt.Sprintf("--remotesigner.experimentalrpclisten=%s",
remoteSignerHost),
- "--remotesigner.timeout=15s",
+ fmt.Sprintf("--remotesigner.timeout=%v", wait.DefaultTimeout),
"--remotesigner.experimentalrequesttimeout=15s",
}
@@ -750,9 +756,11 @@ func testOutboundRSMacaroonEnforcement(ht *lntest.HarnessTest) {
// The watch-only node writes its non-admin macaroons during startup,
// before it fully transitions to the ready state. Wait for the invoice
// macaroon to exist before we try to use it below, otherwise this test
- // can race that file creation on slower CI runners.
+ // can race that file creation on slower CI runners. Opening the
+ // database can take a while on remote backends, so use the default
+ // timeout.
_, err := watchOnly.ReadMacaroon(
- watchOnly.Cfg.InvoiceMacPath, 15*time.Second,
+ watchOnly.Cfg.InvoiceMacPath, wait.DefaultTimeout,
)
require.NoError(ht, err)
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.