66import java .util .HashMap ;
77import java .util .List ;
88import java .util .Map ;
9+ import java .util .concurrent .Callable ;
910
1011import oracle .weblogic .kubernetes .actions .impl .UniqueName ;
1112import oracle .weblogic .kubernetes .actions .impl .primitive .Command ;
5556import static oracle .weblogic .kubernetes .utils .CommonTestUtils .backupReports ;
5657import static oracle .weblogic .kubernetes .utils .CommonTestUtils .getUniqueName ;
5758import static oracle .weblogic .kubernetes .utils .CommonTestUtils .restoreReports ;
59+ import static oracle .weblogic .kubernetes .utils .CommonTestUtils .testUntil ;
60+ import static oracle .weblogic .kubernetes .utils .CommonTestUtils .withLongRetryPolicy ;
5861import static oracle .weblogic .kubernetes .utils .ImageUtils .createBaseRepoSecret ;
5962import static oracle .weblogic .kubernetes .utils .ImageUtils .createTestRepoSecret ;
6063import static oracle .weblogic .kubernetes .utils .SampleUtils .createPVHostPathAndChangePermissionInKindCluster ;
6164import static oracle .weblogic .kubernetes .utils .ThreadSafeLogger .getLogger ;
6265import static org .junit .jupiter .api .Assertions .assertNotNull ;
63- import static org .junit .jupiter .api .Assertions .assertTrue ;
6466
6567/**
6668 * Test and verify Domain on PV FMW domain sample.
@@ -256,16 +258,20 @@ public void testInitialMain() {
256258 createPVHostPathAndChangePermissionInKindCluster ("/shared" , envMap );
257259 }
258260
259- execTestScriptAndAssertSuccess ("-initial-main" , "Failed to run -initial-main" );
261+ testUntil (
262+ withLongRetryPolicy ,
263+ checkTestScriptAndAssertSuccess ("-initial-main" , "Failed to run -initial-main" ),
264+ logger ,
265+ "create PV HostPath and change Permission in Kind Cluster" );
260266 }
261267
262268 /**
263269 * Run script run-test.sh.
264270 * @param arg arguments to execute script
265271 * @param errString a string of detailed error
266272 */
267- private void execTestScriptAndAssertSuccess (String arg ,
268- String errString ) {
273+ private boolean execTestScriptAndAssertSuccess (String arg ,
274+ String errString ) {
269275
270276 Assumptions .assumeTrue (previousTestSuccessful );
271277 previousTestSuccessful = false ;
@@ -292,9 +298,15 @@ private void execTestScriptAndAssertSuccess(String arg,
292298 outStr += ", stderr=\n {\n " + (result != null ? result .stderr () : "" ) + "\n }\n " ;
293299 outStr += ", stdout=\n {\n " + (result != null ? result .stdout () : "" ) + "\n }\n " ;
294300
295- assertTrue ( success , outStr );
301+ logger . info ( "output String is: {0}" , outStr );
296302
297303 previousTestSuccessful = true ;
304+
305+ return success ;
306+ }
307+
308+ private Callable <Boolean > checkTestScriptAndAssertSuccess (String arg , String errString ) {
309+ return () -> execTestScriptAndAssertSuccess (arg , errString );
298310 }
299311
300312 /**
0 commit comments