@@ -1128,7 +1128,7 @@ func TestInitLivenessAndReadinessProbe(t *testing.T) {
1128
1128
assert .Nil (t , rayContainer .LivenessProbe .Exec )
1129
1129
assert .Nil (t , rayContainer .ReadinessProbe .Exec )
1130
1130
1131
- // Test 2: User does not define a custom probe. KubeRay will inject Exec probe.
1131
+ // Test 2: User does not define a custom probe. KubeRay will inject Exec probe for worker pod .
1132
1132
// Here we test the case where the Ray Pod originates from RayServiceCRD,
1133
1133
// implying that an additional serve health check will be added to the readiness probe.
1134
1134
rayContainer .LivenessProbe = nil
@@ -1138,4 +1138,20 @@ func TestInitLivenessAndReadinessProbe(t *testing.T) {
1138
1138
assert .NotNil (t , rayContainer .ReadinessProbe .Exec )
1139
1139
assert .False (t , strings .Contains (strings .Join (rayContainer .LivenessProbe .Exec .Command , " " ), utils .RayServeProxyHealthPath ))
1140
1140
assert .True (t , strings .Contains (strings .Join (rayContainer .ReadinessProbe .Exec .Command , " " ), utils .RayServeProxyHealthPath ))
1141
+ assert .Equal (t , int32 (2 ), rayContainer .LivenessProbe .TimeoutSeconds )
1142
+ assert .Equal (t , int32 (2 ), rayContainer .ReadinessProbe .TimeoutSeconds )
1143
+
1144
+ // Test 3: User does not define a custom probe. KubeRay will inject Exec probe for head pod.
1145
+ // Here we test the case where the Ray Pod originates from RayServiceCRD,
1146
+ // implying that an additional serve health check will be added to the readiness probe.
1147
+ rayContainer .LivenessProbe = nil
1148
+ rayContainer .ReadinessProbe = nil
1149
+ initLivenessAndReadinessProbe (rayContainer , rayv1 .HeadNode , utils .RayServiceCRD )
1150
+ assert .NotNil (t , rayContainer .LivenessProbe .Exec )
1151
+ assert .NotNil (t , rayContainer .ReadinessProbe .Exec )
1152
+ // head pod should not have Ray Serve proxy health probes
1153
+ assert .False (t , strings .Contains (strings .Join (rayContainer .LivenessProbe .Exec .Command , " " ), utils .RayServeProxyHealthPath ))
1154
+ assert .False (t , strings .Contains (strings .Join (rayContainer .ReadinessProbe .Exec .Command , " " ), utils .RayServeProxyHealthPath ))
1155
+ assert .Equal (t , int32 (5 ), rayContainer .LivenessProbe .TimeoutSeconds )
1156
+ assert .Equal (t , int32 (5 ), rayContainer .ReadinessProbe .TimeoutSeconds )
1141
1157
}
0 commit comments