Skip to content

Commit

Permalink
IntegraionTests: Waiting for expected conditions before emulate JobSe…
Browse files Browse the repository at this point in the history
…t controller manager

Signed-off-by: Yuki Iwai <[email protected]>
  • Loading branch information
tenzen-y committed Feb 6, 2025
1 parent 9fbe4e9 commit 4fb3818
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions test/integration/controller/trainjob_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,26 @@ var _ = ginkgo.Describe("TrainJob controller", ginkgo.Ordered, func() {
g.Expect(k8sClient.Update(ctx, gotTrainJob)).Should(gomega.Succeed())
}, util.Timeout, util.Interval).Should(gomega.Succeed())

ginkgo.By("Waiting for TrainJob Created=True and Suspended=False condition")
gomega.Eventually(func(g gomega.Gomega) {
gotTrainJob := &trainer.TrainJob{}
g.Expect(k8sClient.Get(ctx, trainJobKey, gotTrainJob)).Should(gomega.Succeed())
g.Expect(gotTrainJob.Status.Conditions).Should(gomega.BeComparableTo([]metav1.Condition{
{
Type: trainer.TrainJobSuspended,
Status: metav1.ConditionFalse,
Reason: trainer.TrainJobResumedReason,
Message: constants.TrainJobResumedMessage,
},
{
Type: trainer.TrainJobCreated,
Status: metav1.ConditionTrue,
Reason: trainer.TrainJobJobsCreationSucceededReason,
Message: constants.TrainJobJobsCreationSucceededMessage,
},
}, util.IgnoreConditions))
}, util.Timeout, util.Interval).Should(gomega.Succeed())

ginkgo.By("Updating the JobSet condition with Failed")
gomega.Eventually(func(g gomega.Gomega) {
jobSet := &jobsetv1alpha2.JobSet{}
Expand Down

0 comments on commit 4fb3818

Please sign in to comment.