Skip to content

Commit

Permalink
itest: speed up node startup
Browse files Browse the repository at this point in the history
  • Loading branch information
guggero committed Feb 16, 2024
1 parent 8d8f19e commit 9aead7d
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions itest/tapd_harness.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"encoding/hex"
"flag"
"fmt"
"net"
"os"
"path/filepath"
"sync"
Expand Down Expand Up @@ -305,10 +306,18 @@ func (hs *tapdHarness) start(expectErrExit bool) error {
}
}()

time.Sleep(1 * time.Second)
// Let's wait until the RPC server is actually listening before we
// connect our client to it.
listenerAddr := hs.clientCfg.RpcConf.RawRPCListeners[0]
err = wait.NoError(func() error {
_, err := net.Dial("tcp", listenerAddr)
return err
}, defaultTimeout)
if err != nil {
return fmt.Errorf("error waiting for server to start: %v", err)
}

// Create our client to interact with the tapd RPC server directly.
listenerAddr := hs.clientCfg.RpcConf.RawRPCListeners[0]
rpcConn, err := dialServer(
listenerAddr, hs.clientCfg.RpcConf.TLSCertPath,
hs.clientCfg.RpcConf.MacaroonPath,
Expand Down

0 comments on commit 9aead7d

Please sign in to comment.