Skip to content

Commit 69f3cfb

Browse files
committed
Merge branch 'fmwdomainonpvsample-fix-main' into 'main'
Forward port the changes in JIRA OWLS-118501 to main See merge request weblogic-cloud/weblogic-kubernetes-operator!4769
2 parents 6187b48 + d5da6d8 commit 69f3cfb

File tree

1 file changed

+19
-6
lines changed

1 file changed

+19
-6
lines changed

integration-tests/src/test/java/oracle/weblogic/kubernetes/ItFmwDomainOnPVSample.java

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
// Copyright (c) 2023, Oracle and/or its affiliates.
1+
// Copyright (c) 2023, 2024, Oracle and/or its affiliates.
22
// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
33

44
package oracle.weblogic.kubernetes;
55

66
import java.util.HashMap;
77
import java.util.List;
88
import java.util.Map;
9+
import java.util.concurrent.Callable;
910

1011
import oracle.weblogic.kubernetes.actions.impl.UniqueName;
1112
import oracle.weblogic.kubernetes.actions.impl.primitive.Command;
@@ -54,12 +55,13 @@
5455
import static oracle.weblogic.kubernetes.utils.CommonTestUtils.backupReports;
5556
import static oracle.weblogic.kubernetes.utils.CommonTestUtils.getUniqueName;
5657
import static oracle.weblogic.kubernetes.utils.CommonTestUtils.restoreReports;
58+
import static oracle.weblogic.kubernetes.utils.CommonTestUtils.testUntil;
59+
import static oracle.weblogic.kubernetes.utils.CommonTestUtils.withLongRetryPolicy;
5760
import static oracle.weblogic.kubernetes.utils.ImageUtils.createBaseRepoSecret;
5861
import static oracle.weblogic.kubernetes.utils.ImageUtils.createTestRepoSecret;
5962
import static oracle.weblogic.kubernetes.utils.SampleUtils.createPVHostPathAndChangePermissionInKindCluster;
6063
import static oracle.weblogic.kubernetes.utils.ThreadSafeLogger.getLogger;
6164
import static org.junit.jupiter.api.Assertions.assertNotNull;
62-
import static org.junit.jupiter.api.Assertions.assertTrue;
6365

6466
/**
6567
* Test and verify Domain on PV FMW domain sample.
@@ -248,16 +250,21 @@ public void testInitialMain() {
248250
createPVHostPathAndChangePermissionInKindCluster("/shared", envMap);
249251
}
250252

251-
execTestScriptAndAssertSuccess("-initial-main", "Failed to run -initial-main");
253+
testUntil(
254+
withLongRetryPolicy,
255+
checkTestScriptAndAssertSuccess("-initial-main", "Failed to run -initial-main"),
256+
logger,
257+
"create PV HostPath and change Permission in Kind Cluster");
258+
252259
}
253260

254261
/**
255262
* Run script run-test.sh.
256263
* @param arg arguments to execute script
257264
* @param errString a string of detailed error
258265
*/
259-
private void execTestScriptAndAssertSuccess(String arg,
260-
String errString) {
266+
private boolean execTestScriptAndAssertSuccess(String arg,
267+
String errString) {
261268

262269
Assumptions.assumeTrue(previousTestSuccessful);
263270
previousTestSuccessful = false;
@@ -284,9 +291,15 @@ private void execTestScriptAndAssertSuccess(String arg,
284291
outStr += ", stderr=\n{\n" + (result != null ? result.stderr() : "") + "\n}\n";
285292
outStr += ", stdout=\n{\n" + (result != null ? result.stdout() : "") + "\n}\n";
286293

287-
assertTrue(success, outStr);
294+
logger.info("output String is: {0}", outStr);
288295

289296
previousTestSuccessful = true;
297+
298+
return success;
299+
}
300+
301+
private Callable<Boolean> checkTestScriptAndAssertSuccess(String arg, String errString) {
302+
return () -> execTestScriptAndAssertSuccess(arg, errString);
290303
}
291304

292305
/**

0 commit comments

Comments
 (0)