diff --git a/test/e2e/apps/daemon_set.go b/test/e2e/apps/daemon_set.go index a50b83e75f2..f7296e0e846 100644 --- a/test/e2e/apps/daemon_set.go +++ b/test/e2e/apps/daemon_set.go @@ -105,7 +105,7 @@ func updateDaemonSetWithRetries(ctx context.Context, c clientset.Interface, name updateErr = err return false, nil }) - if pollErr == wait.ErrWaitTimeout { + if wait.Interrupted(pollErr) { pollErr = fmt.Errorf("couldn't apply the provided updated to DaemonSet %q: %v", name, updateErr) } return ds, pollErr diff --git a/test/e2e/apps/deployment.go b/test/e2e/apps/deployment.go index 4d5fb39d7d6..bf03b1e1e32 100644 --- a/test/e2e/apps/deployment.go +++ b/test/e2e/apps/deployment.go @@ -1549,7 +1549,7 @@ func watchRecreateDeployment(ctx context.Context, c clientset.Interface, d *apps ctxUntil, cancel := context.WithTimeout(ctx, 2*time.Minute) defer cancel() _, err := watchtools.Until(ctxUntil, d.ResourceVersion, w, condition) - if err == wait.ErrWaitTimeout { + if wait.Interrupted(err) { err = fmt.Errorf("deployment %q never completed: %#v", d.Name, status) } return err @@ -1573,7 +1573,7 @@ func waitForDeploymentOldRSsNum(ctx context.Context, c clientset.Interface, ns, } return len(oldRSs) == desiredRSNum, nil }) - if pollErr == wait.ErrWaitTimeout { + if wait.Interrupted(pollErr) { pollErr = fmt.Errorf("%d old replica sets were not cleaned up for deployment %q", len(oldRSs)-desiredRSNum, deploymentName) testutil.LogReplicaSetsOfDeployment(d, oldRSs, nil, framework.Logf) } @@ -1590,7 +1590,7 @@ func waitForReplicaSetDesiredReplicas(ctx context.Context, rsClient appsclient.R } return rs.Status.ObservedGeneration >= desiredGeneration && rs.Status.Replicas == *(replicaSet.Spec.Replicas) && rs.Status.Replicas == *(rs.Spec.Replicas), nil }) - if err == wait.ErrWaitTimeout { + if wait.Interrupted(err) { err = fmt.Errorf("replicaset %q never had desired number of replicas", replicaSet.Name) } return err @@ -1606,7 +1606,7 @@ func waitForReplicaSetTargetSpecReplicas(ctx context.Context, c clientset.Interf } return rs.Status.ObservedGeneration >= desiredGeneration && *rs.Spec.Replicas == targetReplicaNum, nil }) - if err == wait.ErrWaitTimeout { + if wait.Interrupted(err) { err = fmt.Errorf("replicaset %q never had desired number of .spec.replicas", replicaSet.Name) } return err diff --git a/test/e2e/apps/job.go b/test/e2e/apps/job.go index a35d10e0900..88b15c6efa4 100644 --- a/test/e2e/apps/job.go +++ b/test/e2e/apps/job.go @@ -19,6 +19,7 @@ package apps import ( "context" "encoding/json" + "errors" "fmt" "strconv" "time" @@ -286,7 +287,7 @@ var _ = SIGDescribe("Job", func() { return false, err } return len(pods.Items) > 0, nil - }), wait.ErrWaitTimeout) + }), wait.ErrorInterrupted(errors.New("timed out waiting for the condition"))) ginkgo.By("Checking Job status to observe Suspended state") job, err = e2ejob.GetJob(ctx, f.ClientSet, f.Namespace.Name, job.Name) diff --git a/test/e2e/apps/rc.go b/test/e2e/apps/rc.go index d20e6d709c7..5939c34c5f4 100644 --- a/test/e2e/apps/rc.go +++ b/test/e2e/apps/rc.go @@ -19,6 +19,7 @@ package apps import ( "context" "encoding/json" + "errors" "fmt" "time" @@ -554,7 +555,7 @@ func testReplicationControllerConditionCheck(ctx context.Context, f *framework.F quantity := resource.MustParse("2") return (&podQuota).Cmp(quantity) == 0, nil }) - if err == wait.ErrWaitTimeout { + if wait.Interrupted(err) { err = fmt.Errorf("resource quota %q never synced", name) } framework.ExpectNoError(err) @@ -581,7 +582,7 @@ func testReplicationControllerConditionCheck(ctx context.Context, f *framework.F cond := replication.GetCondition(rc.Status, v1.ReplicationControllerReplicaFailure) return cond != nil, nil }) - if err == wait.ErrWaitTimeout { + if wait.Interrupted(err) { err = fmt.Errorf("rc manager never added the failure condition for rc %q: %#v", name, conditions) } framework.ExpectNoError(err) @@ -610,7 +611,7 @@ func testReplicationControllerConditionCheck(ctx context.Context, f *framework.F cond := replication.GetCondition(rc.Status, v1.ReplicationControllerReplicaFailure) return cond == nil, nil }) - if err == wait.ErrWaitTimeout { + if wait.Interrupted(err) { err = fmt.Errorf("rc manager never removed the failure condition for rc %q: %#v", name, conditions) } framework.ExpectNoError(err) @@ -732,7 +733,7 @@ func updateReplicationControllerWithRetries(ctx context.Context, c clientset.Int updateErr = err return false, nil }) - if pollErr == wait.ErrWaitTimeout { + if wait.Interrupted(pollErr) { pollErr = fmt.Errorf("couldn't apply the provided updated to rc %q: %v", name, updateErr) } return rc, pollErr @@ -778,7 +779,7 @@ func watchUntilWithoutRetry(ctx context.Context, watcher watch.Interface, condit } case <-ctx.Done(): - return lastEvent, wait.ErrWaitTimeout + return lastEvent, wait.ErrorInterrupted(errors.New("timed out waiting for the condition")) } } } diff --git a/test/e2e/apps/replica_set.go b/test/e2e/apps/replica_set.go index 007f048681b..e72f40a1b70 100644 --- a/test/e2e/apps/replica_set.go +++ b/test/e2e/apps/replica_set.go @@ -251,7 +251,7 @@ func testReplicaSetConditionCheck(ctx context.Context, f *framework.Framework) { podQuota := quota.Status.Hard[v1.ResourcePods] return (&podQuota).Cmp(quantity) == 0, nil }) - if err == wait.ErrWaitTimeout { + if wait.Interrupted(err) { err = fmt.Errorf("resource quota %q never synced", name) } framework.ExpectNoError(err) @@ -279,7 +279,7 @@ func testReplicaSetConditionCheck(ctx context.Context, f *framework.Framework) { return cond != nil, nil }) - if err == wait.ErrWaitTimeout { + if wait.Interrupted(err) { err = fmt.Errorf("rs controller never added the failure condition for replica set %q: %#v", name, conditions) } framework.ExpectNoError(err) @@ -308,7 +308,7 @@ func testReplicaSetConditionCheck(ctx context.Context, f *framework.Framework) { cond := replicaset.GetCondition(rs.Status, appsv1.ReplicaSetReplicaFailure) return cond == nil, nil }) - if err == wait.ErrWaitTimeout { + if wait.Interrupted(err) { err = fmt.Errorf("rs controller never removed the failure condition for rs %q: %#v", name, conditions) } framework.ExpectNoError(err) diff --git a/test/e2e/apps/statefulset.go b/test/e2e/apps/statefulset.go index baa36de7638..d97e127f41e 100644 --- a/test/e2e/apps/statefulset.go +++ b/test/e2e/apps/statefulset.go @@ -1836,7 +1836,7 @@ func pollReadWithTimeout(ctx context.Context, statefulPod statefulPodTester, sta return true, nil }) - if err == wait.ErrWaitTimeout { + if wait.Interrupted(err) { return fmt.Errorf("timed out when trying to read value for key %v from stateful pod %d", key, statefulPodNumber) } return err @@ -2058,7 +2058,7 @@ func updateStatefulSetWithRetries(ctx context.Context, c clientset.Interface, na updateErr = err return false, nil }) - if pollErr == wait.ErrWaitTimeout { + if wait.Interrupted(pollErr) { pollErr = fmt.Errorf("couldn't apply the provided updated to stateful set %q: %v", name, updateErr) } return statefulSet, pollErr diff --git a/test/e2e/apps/ttl_after_finished.go b/test/e2e/apps/ttl_after_finished.go index 67fabeab76a..0c73cceb4d1 100644 --- a/test/e2e/apps/ttl_after_finished.go +++ b/test/e2e/apps/ttl_after_finished.go @@ -139,7 +139,7 @@ func updateJobWithRetries(ctx context.Context, c clientset.Interface, namespace, updateErr = err return false, nil }) - if pollErr == wait.ErrWaitTimeout { + if wait.Interrupted(pollErr) { pollErr = fmt.Errorf("couldn't apply the provided updated to job %q: %v", name, updateErr) } return job, pollErr