Skip to content

Conversation

@maggiehe00
Copy link
Contributor

@maggiehe00 maggiehe00 commented Jul 26, 2021

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/

@maggiehe00 maggiehe00 requested review from anpanigr and sankarpn July 26, 2021 16:06
assertDoesNotThrow(() -> getCurrentIntrospectVersion(domainUid, fmwDomainNamespace));
logger.info("Before restarting operator introspectVersion is: " + introspectVersion1);

logger.info("Is going to restart operator in the namespace: " + opNamespace);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
logger.info("Is going to restart operator in the namespace: " + opNamespace);
logger.info("Restarting operator in the namespace: " + opNamespace);

Copy link
Contributor Author

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);
Copy link
Member

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.

Copy link
Contributor Author

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;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove commented out imports

Copy link
Contributor Author

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;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove commented out imports

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Copy link
Member

@anpanigr anpanigr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@sankarpn sankarpn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@rjeberhard rjeberhard merged commit 45cea00 into main Jul 29, 2021
@rjeberhard rjeberhard deleted the introver branch January 31, 2022 14:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants