lnwallet/test: make the timeout err msg and actual timeout consistent
What changed, and why it matters
This commit only fixes a mismatch between error messages and actual timeout durations in test helper code. It does not change production behavior or fix any security issue.
No security action needed. Treat as normal test maintenance.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch updates two test helper functions in lnwallet/test/test_interface.go. waitForMempoolTx’s actual timeout was already 30 seconds but its error said 10 seconds; the message is corrected. waitForWalletSync’s timeout is increased from 10 to 30 seconds and its error message is changed from fmt.Errorf to errors.New. These are purely test-code consistency/cosmetic changes with no security implications.
Changed components
lnwallet/test/test_interface.goInspect captured patch +4 / −3
diff --git a/lnwallet/test/test_interface.go b/lnwallet/test/test_interface.go
index 8dce489..853d68a 100644
--- a/lnwallet/test/test_interface.go
+++ b/lnwallet/test/test_interface.go
@@ -4,6 +4,7 @@ import (
"bytes"
"crypto/sha256"
"encoding/hex"
+ "errors"
"fmt"
"net"
"path/filepath"
@@ -2977,7 +2978,7 @@ func waitForMempoolTx(r *rpctest.Harness, txid *chainhash.Hash) error {
// Do a short wait
select {
case <-timeout:
- return fmt.Errorf("timeout after 10s")
+ return errors.New("timeout after 30s")
default:
}
time.Sleep(100 * time.Millisecond)
@@ -3008,12 +3009,12 @@ func waitForWalletSync(r *rpctest.Harness, w *lnwallet.LightningWallet) error {
bestHash, knownHash *chainhash.Hash
bestHeight, knownHeight int32
)
- timeout := time.After(10 * time.Second)
+ timeout := time.After(30 * time.Second)
for !synced {
// Do a short wait
select {
case <-timeout:
- return fmt.Errorf("timeout after 30s")
+ return errors.New("timeout after 30s")
case <-time.Tick(100 * time.Millisecond):
}
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.