Skip to content

Commit 3f186bf

Browse files
authored
It resilience (#1600)
* do not fail the whole test if the curl command returns a non-zero status we expect if to fail, and want to retry it until it is successful. it can fail because the web app has not had time to start up yet. the current code throws a runtime exception on a non-zero return code, which causes this test to fail too fast and incorrectly. * use vanaja's simpler solution * fix code so it retries and does not die on RuntimeException on first iteration. Observed a failure in this run: https://build.weblogick8s.org:8443/job/weblogic-kubernetes-operator-quicktest/1375/testReport/oracle.kubernetes.operator/ItElasticLogging/testWebLogicLogSearch/ testWebLogicLogSearch fails arund line 1114 of the log (out file). The first fall to execSearchQuery is getting rc=6 from the curl command and then throws an RE and prematurely aborts the test. This PR changes it to use ExecCommand.exec() instead of TestUtils.exec() so that the result is just returned to the called without killing the test run.
1 parent f543c64 commit 3f186bf

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import java.util.regex.Pattern;
1515

1616
import oracle.kubernetes.operator.utils.Domain;
17+
import oracle.kubernetes.operator.utils.ExecCommand;
1718
import oracle.kubernetes.operator.utils.ExecResult;
1819
import oracle.kubernetes.operator.utils.LoggerHelper;
1920
import oracle.kubernetes.operator.utils.Operator;
@@ -514,7 +515,7 @@ private String execSearchQuery(String queryCriteria, String index)
514515
.append("'")
515516
.toString();
516517
LoggerHelper.getLocal().log(Level.INFO, "Command to search: " + cmd);
517-
ExecResult result = TestUtils.exec(cmd);
518+
ExecResult result = ExecCommand.exec(cmd);
518519

519520
return result.stdout();
520521
}

0 commit comments

Comments
 (0)