mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-25 05:02:32 +02:00
lnwallet/test: make the timeout err msg and actual timeout consistent
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
|||||||
"bytes"
|
"bytes"
|
||||||
"crypto/sha256"
|
"crypto/sha256"
|
||||||
"encoding/hex"
|
"encoding/hex"
|
||||||
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"net"
|
"net"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
@@ -2977,7 +2978,7 @@ func waitForMempoolTx(r *rpctest.Harness, txid *chainhash.Hash) error {
|
|||||||
// Do a short wait
|
// Do a short wait
|
||||||
select {
|
select {
|
||||||
case <-timeout:
|
case <-timeout:
|
||||||
return fmt.Errorf("timeout after 10s")
|
return errors.New("timeout after 30s")
|
||||||
default:
|
default:
|
||||||
}
|
}
|
||||||
time.Sleep(100 * time.Millisecond)
|
time.Sleep(100 * time.Millisecond)
|
||||||
@@ -3008,12 +3009,12 @@ func waitForWalletSync(r *rpctest.Harness, w *lnwallet.LightningWallet) error {
|
|||||||
bestHash, knownHash *chainhash.Hash
|
bestHash, knownHash *chainhash.Hash
|
||||||
bestHeight, knownHeight int32
|
bestHeight, knownHeight int32
|
||||||
)
|
)
|
||||||
timeout := time.After(10 * time.Second)
|
timeout := time.After(30 * time.Second)
|
||||||
for !synced {
|
for !synced {
|
||||||
// Do a short wait
|
// Do a short wait
|
||||||
select {
|
select {
|
||||||
case <-timeout:
|
case <-timeout:
|
||||||
return fmt.Errorf("timeout after 30s")
|
return errors.New("timeout after 30s")
|
||||||
case <-time.Tick(100 * time.Millisecond):
|
case <-time.Tick(100 * time.Millisecond):
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user