-
Notifications
You must be signed in to change notification settings - Fork 216
Add test to verify the restarted operator would detect the existing introspector and wait for the job to complete #2482
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
integration-tests/src/test/java/oracle/weblogic/kubernetes/ItFmwMiiDomain.java
Show resolved
Hide resolved
| assertDoesNotThrow(() -> getCurrentIntrospectVersion(domainUid, fmwDomainNamespace)); | ||
| logger.info("Before restarting operator introspectVersion is: " + introspectVersion1); | ||
|
|
||
| logger.info("Is going to restart operator in the namespace: " + opNamespace); |
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.
| logger.info("Is going to restart operator in the namespace: " + opNamespace); | |
| logger.info("Restarting operator in the namespace: " + opNamespace); |
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.
Done
| logger.info("Is going to restart operator in the namespace: " + opNamespace); | ||
| restartOperator(opNamespace); | ||
| //verify introspectorVersion does not change | ||
| checkPodExists(introspectPodNameBase, domainUid, fmwDomainNamespace); |
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.
what is the guarantee that the introspector pod will still be running? It might have finished running before operator is restarted.
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.
Here we pickup FMW domain because we know FMW domain has long running introspector job, usually taking around 5 mins and we have introspectorJobActiveDeadlineSeconds(600L).
So under normal circumstance introspector pod would still be running after operator is restarted. And after the operator is restarted I verify the intropsector pod is still running.
But you are right the testing logic itself doesn't guarantee that.
Maybe I should fail the test if after operator restarting the introspector pod doesn't exist?
| import static oracle.weblogic.kubernetes.TestConstants.DOMAIN_API_VERSION; | ||
| import static oracle.weblogic.kubernetes.TestConstants.FMWINFRA_IMAGE_TO_USE_IN_SPEC; | ||
| import static oracle.weblogic.kubernetes.TestConstants.K8S_NODEPORT_HOST; | ||
| //import static oracle.weblogic.kubernetes.actions.TestActions.getNextIntrospectVersion; |
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.
remove commented out imports
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.
Done
| import static oracle.weblogic.kubernetes.utils.CommonTestUtils.getExternalServicePodName; | ||
| import static oracle.weblogic.kubernetes.utils.TestUtils.callWebAppAndWaitTillReady; | ||
| import static oracle.weblogic.kubernetes.utils.ThreadSafeLogger.getLogger; | ||
| //import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; |
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.
remove commented out imports
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.
Done
integration-tests/src/test/java/oracle/weblogic/kubernetes/ItFmwMiiDomain.java
Outdated
Show resolved
Hide resolved
anpanigr
left a comment
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
sankarpn
left a comment
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
This test is to verify the restarted operator can find the existing introspector job and wait for those results rather than deleting the job and replacing it.
After addressing the latest review comments, single test Jenkins passed
https://build.weblogick8s.org:8443/job/weblogic-kubernetes-operator-kind-new/5810/
Full Jenkins parallel test failed with 3 other test classes
https://build.weblogick8s.org:8443/job/weblogic-kubernetes-operator-kind-new/5811/