Skip to content

Commit 112dc75

Browse files
authored
IntegraionTests: Waiting for expected conditions before emulate JobSet controller manager (#2425)
Signed-off-by: Yuki Iwai <[email protected]>
1 parent cc40702 commit 112dc75

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

test/integration/controller/trainjob_controller_test.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,26 @@ var _ = ginkgo.Describe("TrainJob controller", ginkgo.Ordered, func() {
448448
g.Expect(k8sClient.Update(ctx, gotTrainJob)).Should(gomega.Succeed())
449449
}, util.Timeout, util.Interval).Should(gomega.Succeed())
450450

451+
ginkgo.By("Waiting for TrainJob Created=True and Suspended=False condition")
452+
gomega.Eventually(func(g gomega.Gomega) {
453+
gotTrainJob := &trainer.TrainJob{}
454+
g.Expect(k8sClient.Get(ctx, trainJobKey, gotTrainJob)).Should(gomega.Succeed())
455+
g.Expect(gotTrainJob.Status.Conditions).Should(gomega.BeComparableTo([]metav1.Condition{
456+
{
457+
Type: trainer.TrainJobSuspended,
458+
Status: metav1.ConditionFalse,
459+
Reason: trainer.TrainJobResumedReason,
460+
Message: constants.TrainJobResumedMessage,
461+
},
462+
{
463+
Type: trainer.TrainJobCreated,
464+
Status: metav1.ConditionTrue,
465+
Reason: trainer.TrainJobJobsCreationSucceededReason,
466+
Message: constants.TrainJobJobsCreationSucceededMessage,
467+
},
468+
}, util.IgnoreConditions))
469+
}, util.Timeout, util.Interval).Should(gomega.Succeed())
470+
451471
ginkgo.By("Updating the JobSet condition with Failed")
452472
gomega.Eventually(func(g gomega.Gomega) {
453473
jobSet := &jobsetv1alpha2.JobSet{}

0 commit comments

Comments
 (0)