Skip to content

Commit 845f92a

Browse files
committed
fix unit test
Signed-off-by: You-Cheng Lin (Owen) <[email protected]>
1 parent 7cc7c2d commit 845f92a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

ray-operator/controllers/ray/batchscheduler/yunikorn/yunikorn_scheduler_test.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,7 @@ func TestPropagateTaskGroupsAnnotationToRayClusterAndSubmitterPodTemplate(t *tes
317317
corev1.ResourceCPU: resource.MustParse("2"),
318318
corev1.ResourceMemory: resource.MustParse("10Gi"),
319319
})
320+
rayCluster.Spec.WorkerGroupSpecs[0].NumOfHosts = 1
320321

321322
rayJobWithGangScheduling := createRayJobWithLabels(
322323
"ray-job-with-gang-scheduling",
@@ -426,6 +427,7 @@ func TestAddMetadataToChildResourceFromRayCluster(t *testing.T) {
426427
utils.RayGangSchedulingEnabled: "true",
427428
},
428429
)
430+
429431
addHeadPodSpec(rayCluster, corev1.ResourceList{
430432
corev1.ResourceCPU: resource.MustParse("1"),
431433
corev1.ResourceMemory: resource.MustParse("1Gi"),
@@ -434,7 +436,7 @@ func TestAddMetadataToChildResourceFromRayCluster(t *testing.T) {
434436
corev1.ResourceCPU: resource.MustParse("1"),
435437
corev1.ResourceMemory: resource.MustParse("1Gi"),
436438
})
437-
439+
rayCluster.Spec.WorkerGroupSpecs[0].NumOfHosts = 1
438440
rayPod = createPod("ray-pod", "default")
439441
yk.AddMetadataToChildResource(ctx, rayCluster, rayPod, "ray-cluster-with-gang-scheduling")
440442

@@ -490,7 +492,7 @@ func TestAddMetadataToChildResourceFromRayJob(t *testing.T) {
490492
corev1.ResourceCPU: resource.MustParse("1"),
491493
corev1.ResourceMemory: resource.MustParse("1Gi"),
492494
})
493-
495+
rayCluster.Spec.WorkerGroupSpecs[0].NumOfHosts = 1
494496
rayJob = createRayJobWithLabels(
495497
"ray-job-with-gang-scheduling",
496498
"test-namespace",

0 commit comments

Comments
 (0)