Skip to content

Commit

Permalink
fix: add a wait to the registry startup during tests (#499)
Browse files Browse the repository at this point in the history
  • Loading branch information
UncleGedd committed Mar 12, 2024
1 parent 4e6f50e commit 7ed6040
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/test/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
"runtime"
"strings"
"testing"
"time"

"github.com/defenseunicorns/zarf/src/pkg/message"
"github.com/defenseunicorns/zarf/src/pkg/utils/exec"
Expand Down Expand Up @@ -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)
}

Expand Down

0 comments on commit 7ed6040

Please sign in to comment.