Skip to content

Commit 80839b2

Browse files
committed
Merge branch 'develop' into owls-74263
2 parents b3102f5 + 103b4d2 commit 80839b2

File tree

5 files changed

+49
-7
lines changed

5 files changed

+49
-7
lines changed

integration-tests/src/test/java/oracle/kubernetes/operator/ItMonitoringExporter.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -852,13 +852,12 @@ private void fireAlert() throws Exception {
852852

853853
TestUtils.checkPodReady("domain1-admin-server", "default");
854854
TestUtils.checkPodReady("domain1-managed-server-1", "default");
855-
//sleep for 2 min to fire alert
856-
Thread.sleep(120000);
855+
857856
String webhookPod = getPodName("webhook", "webhook");
858857
String command = "kubectl -n webhook logs " + webhookPod;
859-
ExecResult webhookResult = TestUtils.exec(command);
858+
859+
ExecResult webhookResult = TestUtils.checkAnyCmdInLoop(command, "Some WLS cluster has only one running server for more than 1 minutes");
860860
logger.info(" webhook log " + webhookResult.stdout());
861-
assertTrue(webhookResult.stdout().contains("Some WLS cluster has only one running server for more than 1 minutes"));
862861
}
863862

864863
private static String getPodName(String app, String namespace) throws Exception {

integration-tests/src/test/java/oracle/kubernetes/operator/utils/TestUtils.java

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1224,6 +1224,49 @@ private static KeyStore createKeyStore(Operator operator) throws Exception {
12241224
return myKeyStore;
12251225
}
12261226

1227+
/**
1228+
*
1229+
* @param cmd command to run in the loop
1230+
* @param matchStr expected string to match in the output
1231+
* @return ExecResult object containing command output info
1232+
* @throws Exception exception if fails to execute
1233+
*/
1234+
public static ExecResult checkAnyCmdInLoop(String cmd, String matchStr)
1235+
throws Exception {
1236+
int i = 0;
1237+
ExecResult result = null;
1238+
while (i < BaseTest.getMaxIterationsPod()) {
1239+
result = ExecCommand.exec(cmd);
1240+
1241+
if (result.exitValue() != 0
1242+
|| (result.exitValue() == 0 && !result.stdout().contains(matchStr))) {
1243+
logger.info("Output for " + cmd + "\n" + result.stdout() + "\n " + result.stderr());
1244+
// check for last iteration
1245+
if (i == (BaseTest.getMaxIterationsPod() - 1)) {
1246+
throw new RuntimeException(
1247+
"FAILURE: expected output " + matchStr + " from command " + cmd + " is not receieved, exiting!");
1248+
}
1249+
logger.info(
1250+
"did not receive the expected output "
1251+
+ matchStr
1252+
+ "from command " + cmd + " Ite ["
1253+
+ i
1254+
+ "/"
1255+
+ BaseTest.getMaxIterationsPod()
1256+
+ "], sleeping "
1257+
+ BaseTest.getWaitTimePod()
1258+
+ " seconds more");
1259+
1260+
Thread.sleep(BaseTest.getWaitTimePod() * 1000);
1261+
i++;
1262+
} else {
1263+
logger.info("Command " + cmd + " is successful");
1264+
break;
1265+
}
1266+
}
1267+
return result;
1268+
}
1269+
12271270
public static void checkCmdInLoop(String cmd, String matchStr, String k8sObjName)
12281271
throws Exception {
12291272
int i = 0;

site/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Oracle WebLogic Server Kubernetes Operator documentation
22

3-
Documentation for the current version of the operator, version 2.0.1, is
3+
Documentation for the current version of the operator is
44
available [here](https://oracle.github.io/weblogic-kubernetes-operator).
55

66
If you wish to view documentation for an older version, please see:

site/v2.1/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Oracle WebLogic Server Kubernetes Operator documentation
22

3-
Documentation for the current version of the operator, version 2.0.1, is
3+
Documentation for the current version of the operator is
44
available [here](https://oracle.github.io/weblogic-kubernetes-operator).
55

66
If you wish to view documentation for an older version, please see:

site/v2.2.0/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Oracle WebLogic Server Kubernetes Operator documentation
22

3-
Documentation for the current version of the operator, version 2.0.1, is
3+
Documentation for the current version of the operator is
44
available [here](https://oracle.github.io/weblogic-kubernetes-operator).
55

66
If you wish to view documentation for an older version, please see:

0 commit comments

Comments
 (0)