-
Notifications
You must be signed in to change notification settings - Fork 218
Add Integration Test to allow customization of successThreshold and failureThreshold in weblogic server liveness and readiness probe #2527
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
} | ||
|
||
/** | ||
* Patch the domain with custom readinessProbe failureThreshold and successThreshold value in serverPod. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this test not cover earlier two test methods testCustomLivenessProbeSuccessThreshold() and testCustomLivenessProbeFailureThreshold() ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we check runtime behavior of these two new attributes ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is for readinessProbe. The other two tests are for livenessProbe.
I will add the runtime check for this two attribute.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can u not combine testCustomLivenessProbeSuccessThreshold() and testCustomLivenessProbeFailureThreshold() into a single test method testCustomLivenessProbeFailureThresholdSuccessThreshold()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can
@@ -231,6 +242,324 @@ void testCustomLivenessProbeNotTrigged() { | |||
} | |||
} | |||
|
|||
/** | |||
* Patch the domain with custom livenessProbe failureThreshold and successThreshold value in serverPod. | |||
* Verify the domain is restarted and the failureThreshold and successThreshold is updated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Description does not include runtime behavior check provided in the test
|
||
// check the pod should be restarted after 1m 30s since the livenessProbe periodSeconds defaults to 45s. | ||
// sleep for 1m | ||
try { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we eliminate the 1m hard-code sleep, by reducing the LivenessProbe default to smaller vaule.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reduced the sleep time by change livenessProbe periodSeconds to smaller value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
logger.info("livenessProbe failureThreshold after patch is: {0}", failureThreshold); | ||
assertTrue(failureThreshold.intValue() == 3, "The livenessProbe failureThreshold after patch is not 3"); | ||
|
||
// get the successThreshold of livenessProbe after patch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably this check is not necessary since the successThreshold is not patched and value didn't change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed this check
@@ -114,6 +126,11 @@ public static void initAll(@Namespaces(2) List<String> namespaces) { | |||
|
|||
// create a basic model in image domain | |||
createAndVerifyMiiDomain(imageName); | |||
|
|||
// create temp file | |||
String fileName = "tempFile"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what the temp file is used for. Perhaps the name of the file can be changed to make its purpose more clear and/or comments should be updated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated the comments. This file is also used by other tests in the suite.
logger.info("For server {0} restart count before liveness probe is: {1}", | ||
managedServerPodName, beforeRestartCount); | ||
|
||
String destLocation = "/u01/tempFile.txt"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of copying the file, maybe the test can run a command such as "touch /u01/tempFile.txt" or `echo "Test" > /u01/tempFile.txt" inside the pod to create the file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just reused the method in the other tests.
} catch (InterruptedException ie) { | ||
// ignore | ||
} | ||
int after1mRestartCount = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the sleep value is reduced to 45 seconds, probably this variable name needs to be changed to something like afterDelayRestartCount
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated the variable name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Add integration test to allow customization of successThreshold and failureThreshold in weblogic server liveness and readiness probe
Jenkins result:
https://build.weblogick8s.org:8443/view/all/job/weblogic-kubernetes-operator-kind-new/6445/
https://build.weblogick8s.org:8443/view/all/job/weblogic-kubernetes-operator-kind-new/6444/
Jenkins result for okd:
https://build.weblogick8s.org:8443/view/all/job/wko-okd-test/7/