Skip to content

Commit b5466ee

Browse files
committed
address Pani's comments
1 parent 8a1c216 commit b5466ee

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

integration-tests/src/test/java/oracle/weblogic/kubernetes/ItLivenessProbeCustomization.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,7 @@ void testCustomLivenessProbeNotTrigged() {
245245
/**
246246
* Patch the domain with custom livenessProbe failureThreshold and successThreshold value in serverPod.
247247
* Verify the domain is restarted and the failureThreshold and successThreshold is updated.
248+
* Also verify the failureThreshold runtime behavior is corrected.
248249
*/
249250
@Test
250251
@DisplayName("Test custom livenessProbe failureThreshold and successThreshold in serverPod")
@@ -288,8 +289,9 @@ void testCustomLivenessProbeFailureThresholdSuccessThreshold() {
288289
}
289290

290291
// 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}]";
293295
logger.info("Updating domain configuration using patch string: {0}", patchStr);
294296
assertTrue(patchDomainCustomResource(domainUid, domainNamespace, new V1Patch(patchStr), PATCH_FORMAT_JSON_PATCH),
295297
String.format("failed to patch domain %s in namespace %s", domainUid, domainNamespace));
@@ -349,10 +351,10 @@ void testCustomLivenessProbeFailureThresholdSuccessThreshold() {
349351
tempFile, managedServerPodName, domainNamespace));
350352
logger.info("File copied to Pod {0} in namespace {1}", managedServerPodName, domainNamespace);
351353

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
354356
try {
355-
Thread.sleep(60000);
357+
Thread.sleep(30000);
356358
} catch (InterruptedException ie) {
357359
// ignore
358360
}

0 commit comments

Comments
 (0)