-
Notifications
You must be signed in to change notification settings - Fork 271
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Attempt to handle flakes in upload/annotations tests (#1995)
- Upload tests: We only care that the operation will succeed eventually, were fine with one call failing. - Annotation test: ```bash Operation cannot be fulfilled on pods "cdi-upload-test-dv": the object has been modified; please apply your changes to the latest version and try again ``` Loop over the .Update call here as well, as were fine with it succeeding at some point. Signed-off-by: Alex Kalenyuk <[email protected]>
- Loading branch information
Showing
2 changed files
with
15 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1204,9 +1204,15 @@ var _ = Describe("[vendor:[email protected]][level:component]DataVolume tests", | |
}, timeout, pollingInterval).Should(BeTrue()) | ||
verifyAnnotations(uploadPod) | ||
// Remove non existent network so upload pod succeeds and clone can continue (some envs like OpenShift check network validity) | ||
delete(uploadPod.Annotations, controller.AnnPodNetwork) | ||
_, err = f.K8sClient.CoreV1().Pods(dataVolume.Namespace).Update(context.TODO(), uploadPod, metav1.UpdateOptions{}) | ||
Expect(err).ToNot(HaveOccurred()) | ||
Eventually(func() bool { | ||
uploadPod, err = utils.FindPodByPrefix(f.K8sClient, dataVolume.Namespace, "cdi-upload", common.CDILabelSelector) | ||
if err != nil { | ||
return false | ||
} | ||
delete(uploadPod.Annotations, controller.AnnPodNetwork) | ||
_, err = f.K8sClient.CoreV1().Pods(dataVolume.Namespace).Update(context.TODO(), uploadPod, metav1.UpdateOptions{}) | ||
return err == nil | ||
}, 60*time.Second, 2*time.Second).Should(BeTrue()) | ||
Eventually(func() bool { | ||
sourcePod, err = utils.FindPodBySuffix(f.K8sClient, dataVolume.Namespace, "source-pod", common.CDILabelSelector) | ||
return err == nil | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters