cleanup:e2e:stop using deprecated wait.ErrWaitTimeout

This commit is contained in:
jinye 2023-09-04 21:40:03 +08:00
parent 6586296afc
commit 9795df456f
9 changed files with 10 additions and 10 deletions

View File

@ -1105,7 +1105,7 @@ var _ = SIGDescribe("Garbage collector", func() {
if err := wait.PollWithContext(ctx, 5*time.Second, 30*time.Second+gcInformerResyncRetryTimeout, func(ctx context.Context) (bool, error) {
_, err := resourceClient.Get(ctx, dependentName, metav1.GetOptions{})
return false, err
}); err != nil && err != wait.ErrWaitTimeout {
}); err != nil && !wait.Interrupted(err) {
framework.Failf("failed to ensure the dependent is not deleted: %v", err)
}
})

View File

@ -626,7 +626,7 @@ func ensureDesiredReplicasInRange(ctx context.Context, deploymentName, namespace
}
})
// The call above always returns an error, but if it is timeout, it's OK (condition satisfied all the time).
if err == wait.ErrWaitTimeout {
if wait.Interrupted(err) {
framework.Logf("Number of replicas was stable over %v", timeout)
return
}

View File

@ -367,7 +367,7 @@ var _ = utils.SIGDescribe("CSI Mock volume storage capacity", func() {
if test.expectFailure {
switch {
case errors.Is(err, context.DeadlineExceeded),
errors.Is(err, wait.ErrWaitTimeout),
errors.Is(err, wait.ErrorInterrupted(errors.New("timed out waiting for the condition"))),
errors.Is(err, errNotEnoughSpace):
// Okay, we expected that.
case err == nil:

View File

@ -154,7 +154,7 @@ func UpdatePVSize(ctx context.Context, pv *v1.PersistentVolume, size resource.Qu
}
return true, nil
})
if waitErr == wait.ErrWaitTimeout {
if wait.Interrupted(waitErr) {
return nil, fmt.Errorf("timed out attempting to update PV size. last update error: %v", lastError)
}
if waitErr != nil {

View File

@ -909,7 +909,7 @@ func createLocalPVCsPVs(ctx context.Context, config *localTestConfig, volumes []
}
return false, nil
})
if waitErr == wait.ErrWaitTimeout {
if wait.Interrupted(waitErr) {
framework.Logf("PVCs were not bound within %v (that's good)", bindTimeout)
waitErr = nil
}

View File

@ -315,7 +315,7 @@ func ExpandPVCSize(ctx context.Context, origPVC *v1.PersistentVolumeClaim, size
}
return true, nil
})
if waitErr == wait.ErrWaitTimeout {
if wait.Interrupted(waitErr) {
return nil, fmt.Errorf("timed out attempting to update PVC size. last update error: %v", lastUpdateError)
}
if waitErr != nil {

View File

@ -680,7 +680,7 @@ var _ = utils.SIGDescribe("Dynamic Provisioning", func() {
return false, nil
})
if err == wait.ErrWaitTimeout {
if wait.Interrupted(err) {
framework.Logf("The test missed event about failed provisioning, but checked that no volume was provisioned for %v", framework.ClaimProvisionTimeout)
err = nil
}

View File

@ -91,7 +91,7 @@ func waitForVSphereDisksToDetach(ctx context.Context, nodeVolumes map[string][]s
return true, nil
})
if waitErr != nil {
if waitErr == wait.ErrWaitTimeout {
if wait.Interrupted(waitErr) {
return fmt.Errorf("volumes have not detached after %v: %v", detachTimeout, waitErr)
}
return fmt.Errorf("error waiting for volumes to detach: %v", waitErr)
@ -132,7 +132,7 @@ func waitForVSphereDiskStatus(ctx context.Context, volumePath string, nodeName s
return false, nil
})
if waitErr != nil {
if waitErr == wait.ErrWaitTimeout {
if wait.Interrupted(waitErr) {
return fmt.Errorf("volume %q is not %s %q after %v: %v", volumePath, attachedStateMsg[expectedState], nodeName, timeout, waitErr)
}
return fmt.Errorf("error waiting for volume %q to be %s %q: %v", volumePath, attachedStateMsg[expectedState], nodeName, waitErr)

View File

@ -172,7 +172,7 @@ func waitForPodToFailover(ctx context.Context, client clientset.Interface, deplo
})
if waitErr != nil {
if waitErr == wait.ErrWaitTimeout {
if wait.Interrupted(waitErr) {
return "", fmt.Errorf("pod has not failed over after %v: %v", timeout, waitErr)
}
return "", fmt.Errorf("pod did not fail over from %q: %v", oldNode, waitErr)