Skip to content

Commit

Permalink
de-giteaify condition
Browse files Browse the repository at this point in the history
Signed-off-by: Austin Abro <[email protected]>
  • Loading branch information
AustinAbro321 committed Sep 26, 2024
1 parent 0067651 commit d192ba1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/test/external/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ func createPodInfoPackageWithInsecureSources(t *testing.T, temp string) {
exec.CmdWithPrint(zarfBinPath, "package", "create", temp, "--confirm", "--output", temp)
}

func verifyWaitSuccess(t *testing.T, timeoutMinutes time.Duration, cmd string, args []string, condition string) error {
func waitForCondition(t *testing.T, timeoutMinutes time.Duration, cmd string, args []string, condition string) error {
timeout := time.After(timeoutMinutes * time.Minute)
for {
// delay check 3 seconds
time.Sleep(3 * time.Second)
select {
// on timeout abort
case <-timeout:
return errors.New("unable to verify the gitea container installed successfully")
return errors.New("timed out waiting for condition")

// after delay, try running
default:
Expand Down
2 changes: 1 addition & 1 deletion src/test/external/ext_out_cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func (suite *ExtOutClusterTestSuite) SetupSuite() {

// Wait for gitea to deploy properly
giteaArgs := []string{"inspect", "-f", "{{.State.Health.Status}}", "gitea.localhost"}
err = verifyWaitSuccess(suite.T(), 2, "docker", giteaArgs, "healthy")
err = waitForCondition(suite.T(), 2, "docker", giteaArgs, "healthy")
suite.NoError(err)

// Connect gitea to the k3d network
Expand Down

0 comments on commit d192ba1

Please sign in to comment.