Skip to content

Commit 562cf97

Browse files
authored
ControlPlane: Fix flaky integraion testings due to missing the latest version of object (#2414)
Signed-off-by: Yuki Iwai <[email protected]>
1 parent 7858371 commit 562cf97

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

test/integration/controller.v2/trainjob_controller_test.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,10 @@ var _ = ginkgo.Describe("TrainJob marker validations and defaulting", ginkgo.Ord
613613
ginkgo.DescribeTable("Validate TrainJob on update", func(old func() *kubeflowv2.TrainJob, new func(*kubeflowv2.TrainJob) *kubeflowv2.TrainJob, errorMatcher gomega.OmegaMatcher) {
614614
oldTrainJob := old()
615615
gomega.Expect(k8sClient.Create(ctx, oldTrainJob)).Should(gomega.Succeed())
616-
gomega.Expect(k8sClient.Update(ctx, new(oldTrainJob))).Should(errorMatcher)
616+
gomega.Eventually(func(g gomega.Gomega) {
617+
g.Expect(k8sClient.Get(ctx, client.ObjectKeyFromObject(oldTrainJob), oldTrainJob)).Should(gomega.Succeed())
618+
g.Expect(k8sClient.Update(ctx, new(oldTrainJob))).Should(errorMatcher)
619+
}, util.Timeout, util.Interval).Should(gomega.Succeed())
617620
},
618621
ginkgo.Entry("Should fail to update TrainJob managedBy",
619622
func() *kubeflowv2.TrainJob {

0 commit comments

Comments
 (0)