@@ -245,6 +245,7 @@ void testCustomLivenessProbeNotTrigged() {
245
245
/**
246
246
* Patch the domain with custom livenessProbe failureThreshold and successThreshold value in serverPod.
247
247
* Verify the domain is restarted and the failureThreshold and successThreshold is updated.
248
+ * Also verify the failureThreshold runtime behavior is corrected.
248
249
*/
249
250
@ Test
250
251
@ DisplayName ("Test custom livenessProbe failureThreshold and successThreshold in serverPod" )
@@ -288,8 +289,9 @@ void testCustomLivenessProbeFailureThresholdSuccessThreshold() {
288
289
}
289
290
290
291
// patch the domain with custom failureThreshold
291
- String patchStr =
292
- "[{\" op\" : \" replace\" , \" path\" : \" /spec/serverPod/livenessProbe/failureThreshold\" , \" value\" : 3}]" ;
292
+ String patchStr
293
+ = "[{\" op\" : \" replace\" , \" path\" : \" /spec/serverPod/livenessProbe/failureThreshold\" , \" value\" : 3},"
294
+ + "{\" op\" : \" add\" , \" path\" : \" /spec/serverPod/livenessProbe/periodSeconds\" , \" value\" : 20}]" ;
293
295
logger .info ("Updating domain configuration using patch string: {0}" , patchStr );
294
296
assertTrue (patchDomainCustomResource (domainUid , domainNamespace , new V1Patch (patchStr ), PATCH_FORMAT_JSON_PATCH ),
295
297
String .format ("failed to patch domain %s in namespace %s" , domainUid , domainNamespace ));
@@ -349,10 +351,10 @@ void testCustomLivenessProbeFailureThresholdSuccessThreshold() {
349
351
tempFile , managedServerPodName , domainNamespace ));
350
352
logger .info ("File copied to Pod {0} in namespace {1}" , managedServerPodName , domainNamespace );
351
353
352
- // check the pod should be restarted after 1m 30s since the livenessProbe periodSeconds defaults to 45s .
353
- // sleep for 1m
354
+ // check the pod should be restarted after 40s since the livenessProbe periodSeconds is changed to 20s .
355
+ // sleep for 30s
354
356
try {
355
- Thread .sleep (60000 );
357
+ Thread .sleep (30000 );
356
358
} catch (InterruptedException ie ) {
357
359
// ignore
358
360
}
0 commit comments