functional-tester/agent: wait before loading TLS
@@ -275,8 +275,17 @@ func (srv *Server) saveTLSAssets() error {
func (srv *Server) loadAutoTLSAssets() error {
// if started with auto TLS, sends back TLS assets to tester/client
if srv.Member.Etcd.ClientAutoTLS {
+ // in case of slow disk
+ time.Sleep(time.Second)
+
fdir := filepath.Join(srv.Member.Etcd.DataDir, "fixtures", "client")
+ srv.lg.Info(
+ "loading client TLS assets",
+ zap.String("dir", fdir),
+ zap.String("endpoint", srv.EtcdClientEndpoint),
+ )
+
certPath := filepath.Join(fdir, "cert.pem")
if !fileutil.Exist(certPath) {
return fmt.Errorf("cannot find %q", certPath)
@@ -306,8 +315,17 @@ func (srv *Server) loadAutoTLSAssets() error {
)
}
if srv.Member.Etcd.ClientAutoTLS {
+ // in case of slow disk
+ time.Sleep(time.Second)
+
fdir := filepath.Join(srv.Member.Etcd.DataDir, "fixtures", "peer")
+ srv.lg.Info(
+ "loading client TLS assets",
+ zap.String("dir", fdir),
+ zap.String("endpoint", srv.EtcdClientEndpoint),
+ )
+
certPath := filepath.Join(fdir, "cert.pem")
if !fileutil.Exist(certPath) {
return fmt.Errorf("cannot find %q", certPath)
