From 7ed60409bbb40a79728799940413eea73aeca6ff Mon Sep 17 00:00:00 2001 From: UncleGedd <42304551+UncleGedd@users.noreply.github.com> Date: Tue, 12 Mar 2024 12:38:59 -0500 Subject: [PATCH] fix: add a wait to the registry startup during tests (#499) --- 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) }