lnwallet/interface_test: wait for bitcoind startup
Flakes locally for me on darwin.
This commit is contained in:
parent
3ad7ab223e
commit
2b2c8b5a10
@ -38,6 +38,7 @@ import (
|
||||
"github.com/lightningnetwork/lnd/channeldb/kvdb"
|
||||
"github.com/lightningnetwork/lnd/input"
|
||||
"github.com/lightningnetwork/lnd/keychain"
|
||||
"github.com/lightningnetwork/lnd/lntest/wait"
|
||||
"github.com/lightningnetwork/lnd/lnwallet"
|
||||
"github.com/lightningnetwork/lnd/lnwallet/btcwallet"
|
||||
"github.com/lightningnetwork/lnd/lnwallet/chainfee"
|
||||
@ -3062,21 +3063,25 @@ func runTests(t *testing.T, walletDriver *lnwallet.WalletDriver,
|
||||
defer bitcoind.Process.Kill()
|
||||
|
||||
// Wait for the bitcoind instance to start up.
|
||||
time.Sleep(time.Second)
|
||||
|
||||
host := fmt.Sprintf("127.0.0.1:%d", rpcPort)
|
||||
chainConn, err := chain.NewBitcoindConn(
|
||||
netParams, host, "weks", "weks", zmqBlockHost,
|
||||
zmqTxHost, 100*time.Millisecond,
|
||||
)
|
||||
var chainConn *chain.BitcoindConn
|
||||
err = wait.NoError(func() error {
|
||||
chainConn, err = chain.NewBitcoindConn(
|
||||
netParams, host, "weks", "weks",
|
||||
zmqBlockHost, zmqTxHost,
|
||||
100*time.Millisecond,
|
||||
)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return chainConn.Start()
|
||||
}, 10*time.Second)
|
||||
if err != nil {
|
||||
t.Fatalf("unable to establish connection to "+
|
||||
"bitcoind: %v", err)
|
||||
}
|
||||
if err := chainConn.Start(); err != nil {
|
||||
t.Fatalf("unable to establish connection to "+
|
||||
"bitcoind: %v", err)
|
||||
}
|
||||
defer chainConn.Stop()
|
||||
|
||||
// Create a btcwallet bitcoind client for both Alice and
|
||||
|
Loading…
Reference in New Issue
Block a user