Skip to content

Commit 9405f3d

Browse files
fix: remove duplicate waitUntilKubectl function
1 parent 9089074 commit 9405f3d

File tree

1 file changed

+0
-26
lines changed

1 file changed

+0
-26
lines changed

tests/internal/e2elib/e2elib.go

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -906,29 +906,3 @@ func waitUntilKubectl(t *testing.T, timeout time.Duration, pollInterval time.Dur
906906
}
907907
require.Fail(t, "timed out waiting", "last error: %v", lastErr)
908908
}
909-
910-
// waitUntilKubectl polls by running a kubectl command with the given args
911-
// until the verifyOut predicate returns nil or the timeout is reached.
912-
//
913-
// Unlike require.Eventually, this retains the output of the last mismatch.
914-
func waitUntilKubectl(t *testing.T, timeout time.Duration, pollInterval time.Duration, verifyOut func(output string) error, args ...string) {
915-
var lastErr error
916-
deadline := time.Now().Add(timeout)
917-
for time.Now().Before(deadline) {
918-
cmd := Kubectl(t.Context(), args...)
919-
cmd.Stdout = nil // To ensure that we can capture the output by Output().
920-
out, err := cmd.Output()
921-
if err != nil {
922-
lastErr = err
923-
time.Sleep(pollInterval)
924-
continue
925-
}
926-
err = verifyOut(string(out))
927-
if err == nil {
928-
return
929-
}
930-
lastErr = err
931-
time.Sleep(pollInterval)
932-
}
933-
require.Fail(t, "timed out waiting", "last error: %v", lastErr)
934-
}

0 commit comments

Comments
 (0)