Explorar el Código

Merge pull request #1482 from smallstep/fix-reload-tests

Wait for Accept in TestBootstrapClientServerRotation
Mariano Cano hace 3 años
padre
commit
d604a900ed
Se han modificado 1 ficheros con 7 adiciones y 1 borrados
  1. 7 1
      ca/bootstrap_test.go

+ 7 - 1
ca/bootstrap_test.go

@@ -606,7 +606,13 @@ func doReload(ca *CA) error {
 	}
 	// Use same address in new server
 	newCA.srv.Addr = ca.srv.Addr
-	return ca.srv.Reload(newCA.srv)
+	if err := ca.srv.Reload(newCA.srv); err != nil {
+		return err
+	}
+
+	// Wait a few ms until the http server calls listener.Accept()
+	time.Sleep(100 * time.Millisecond)
+	return nil
 }
 
 func TestBootstrapListener(t *testing.T) {