Skip to content

Commit

Permalink
tests/framework: Replace deprecated poll function
Browse files Browse the repository at this point in the history
Signed-off-by: Shelly Kagan <skagan@redhat.com>
  • Loading branch information
ShellyKa13 committed Dec 8, 2024
1 parent 73897fd commit 425dd1e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/framework/backup.go
Original file line number Diff line number Diff line change
@@ -227,7 +227,7 @@ func GetBackupPhase(ctx context.Context, backupName string, backupNamespace stri
}

func WaitForBackupPhase(ctx context.Context, backupName string, backupNamespace string, expectedPhase v1.BackupPhase) error {
err := wait.PollImmediate(pollInterval, waitTime, func() (bool, error) {
err := wait.PollUntilContextTimeout(ctx, pollInterval, waitTime, false, func(context.Context) (bool, error) {
backup, err := GetBackup(ctx, backupName, backupNamespace)
if err != nil {
ginkgo.By(fmt.Sprintf("Failed getting backup: %s", err.Error()))
@@ -337,7 +337,7 @@ func GetRestorePhase(ctx context.Context, restoreName string, backupNamespace st
}

func WaitForRestorePhase(ctx context.Context, restoreName string, backupNamespace string, expectedPhase v1.RestorePhase) error {
err := wait.PollImmediate(pollInterval, waitTime, func() (bool, error) {
err := wait.PollUntilContextTimeout(ctx, pollInterval, waitTime, false, func(context.Context) (bool, error) {
phase, err := GetRestorePhase(ctx, restoreName, backupNamespace)
ginkgo.By(fmt.Sprintf("Waiting for restore phase %v, got %v", expectedPhase, phase))
if err != nil || phase != expectedPhase {

0 comments on commit 425dd1e

Please sign in to comment.