From a95abe36a9b9bd8080474ca49340e80828a9bb49 Mon Sep 17 00:00:00 2001 From: unclegedd Date: Tue, 12 Mar 2024 10:08:00 -0500 Subject: [PATCH] bug: add a wait to the registry startup during tests --- src/test/common.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/test/common.go b/src/test/common.go index 373f81f2..d6605252 100644 --- a/src/test/common.go +++ b/src/test/common.go @@ -15,6 +15,7 @@ import ( "runtime" "strings" "testing" + "time" "github.com/defenseunicorns/zarf/src/pkg/message" "github.com/defenseunicorns/zarf/src/pkg/utils/exec" @@ -93,6 +94,8 @@ func (e2e *UDSE2ETest) SetupDockerRegistry(t *testing.T, port int) { // spin up a local registry registryImage := "registry:2.8.3" err := exec.CmdWithPrint("docker", "run", "-d", "--restart=always", "-p", fmt.Sprintf("%d:5000", port), "--name", fmt.Sprintf("registry-%d", port), registryImage) + // wait for a half a second to ensure the registry is up and running + time.Sleep(500 * time.Millisecond) require.NoError(t, err) }