6
6
import java .util .HashMap ;
7
7
import java .util .List ;
8
8
import java .util .Map ;
9
+ import java .util .concurrent .Callable ;
9
10
10
11
import oracle .weblogic .kubernetes .actions .impl .UniqueName ;
11
12
import oracle .weblogic .kubernetes .actions .impl .primitive .Command ;
55
56
import static oracle .weblogic .kubernetes .utils .CommonTestUtils .backupReports ;
56
57
import static oracle .weblogic .kubernetes .utils .CommonTestUtils .getUniqueName ;
57
58
import 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 ;
58
61
import static oracle .weblogic .kubernetes .utils .ImageUtils .createBaseRepoSecret ;
59
62
import static oracle .weblogic .kubernetes .utils .ImageUtils .createTestRepoSecret ;
60
63
import static oracle .weblogic .kubernetes .utils .SampleUtils .createPVHostPathAndChangePermissionInKindCluster ;
61
64
import static oracle .weblogic .kubernetes .utils .ThreadSafeLogger .getLogger ;
62
65
import static org .junit .jupiter .api .Assertions .assertNotNull ;
63
- import static org .junit .jupiter .api .Assertions .assertTrue ;
64
66
65
67
/**
66
68
* Test and verify Domain on PV FMW domain sample.
@@ -256,16 +258,20 @@ public void testInitialMain() {
256
258
createPVHostPathAndChangePermissionInKindCluster ("/shared" , envMap );
257
259
}
258
260
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" );
260
266
}
261
267
262
268
/**
263
269
* Run script run-test.sh.
264
270
* @param arg arguments to execute script
265
271
* @param errString a string of detailed error
266
272
*/
267
- private void execTestScriptAndAssertSuccess (String arg ,
268
- String errString ) {
273
+ private boolean execTestScriptAndAssertSuccess (String arg ,
274
+ String errString ) {
269
275
270
276
Assumptions .assumeTrue (previousTestSuccessful );
271
277
previousTestSuccessful = false ;
@@ -292,9 +298,15 @@ private void execTestScriptAndAssertSuccess(String arg,
292
298
outStr += ", stderr=\n {\n " + (result != null ? result .stderr () : "" ) + "\n }\n " ;
293
299
outStr += ", stdout=\n {\n " + (result != null ? result .stdout () : "" ) + "\n }\n " ;
294
300
295
- assertTrue ( success , outStr );
301
+ logger . info ( "output String is: {0}" , outStr );
296
302
297
303
previousTestSuccessful = true ;
304
+
305
+ return success ;
306
+ }
307
+
308
+ private Callable <Boolean > checkTestScriptAndAssertSuccess (String arg , String errString ) {
309
+ return () -> execTestScriptAndAssertSuccess (arg , errString );
298
310
}
299
311
300
312
/**
0 commit comments