Skip to content

Commit

Permalink
[Feature] Improve observability for flaky RayJob test (#1587)
Browse files Browse the repository at this point in the history
  • Loading branch information
kevin85421 authored Nov 2, 2023
1 parent 6fa2d3a commit 244003b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion ray-operator/controllers/ray/rayjob_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -537,12 +537,13 @@ func (r *RayJobReconciler) shouldUpdateJobStatus(oldJobStatus rayv1.JobStatus, o

// make sure the priority is correct
func (r *RayJobReconciler) updateState(ctx context.Context, rayJob *rayv1.RayJob, jobInfo *utils.RayJobInfo, jobStatus rayv1.JobStatus, jobDeploymentStatus rayv1.JobDeploymentStatus, err error) error {
r.Log.Info("UpdateState", "oldJobStatus", rayJob.Status.JobStatus, "newJobStatus", jobStatus, "oldJobDeploymentStatus", rayJob.Status.JobDeploymentStatus, "newJobDeploymentStatus", jobDeploymentStatus)

// Let's skip update the APIServer if it's synced.
if rayJob.Status.JobStatus == jobStatus && rayJob.Status.JobDeploymentStatus == jobDeploymentStatus {
return nil
}

r.Log.Info("UpdateState", "oldJobStatus", rayJob.Status.JobStatus, "newJobStatus", jobStatus, "oldJobDeploymentStatus", rayJob.Status.JobDeploymentStatus, "newJobDeploymentStatus", jobDeploymentStatus)
rayJob.Status.JobStatus = jobStatus
rayJob.Status.JobDeploymentStatus = jobDeploymentStatus
if jobInfo != nil {
Expand Down
2 changes: 1 addition & 1 deletion ray-operator/controllers/ray/rayjob_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ var _ = Context("Inside the default namespace", func() {
It("Dashboard URL should be set", func() {
Eventually(
getDashboardURLForRayJob(ctx, myRayJob),
time.Second*3, time.Millisecond*500).Should(HavePrefix(myRayJob.Name), "Dashboard URL = %v", myRayJob.Status.DashboardURL)
time.Second*1, time.Millisecond*500).Should(HavePrefix(myRayJob.Name), "Dashboard URL = %v", myRayJob.Status.DashboardURL)
})

It("test cluster selector", func() {
Expand Down

0 comments on commit 244003b

Please sign in to comment.