Skip to content

Commit d54892a

Browse files
authored
add retry when deploy application (#3612)
1 parent c12ed6c commit d54892a

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

integration-tests/src/test/java/oracle/weblogic/kubernetes/utils/CommonLBTestUtils.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@
8989
import static oracle.weblogic.kubernetes.utils.ThreadSafeLogger.getLogger;
9090
import static org.apache.commons.io.FileUtils.deleteDirectory;
9191
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
92-
import static org.junit.jupiter.api.Assertions.assertEquals;
9392
import static org.junit.jupiter.api.Assertions.assertFalse;
9493
import static org.junit.jupiter.api.Assertions.assertNotEquals;
9594
import static org.junit.jupiter.api.Assertions.assertNotNull;
@@ -525,11 +524,16 @@ public static void buildAndDeployClusterviewApp(String domainNamespace, List<Str
525524
for (String domainUid : domainUids) {
526525
// admin/managed server name here should match with model yaml in MII_BASIC_WDT_MODEL_FILE
527526
String adminServerPodName = domainUid + "-admin-server";
528-
deployApplication(domainNamespace, domainUid, adminServerPodName, clusterViewAppPath);
527+
testUntil(() -> deployApplication(domainNamespace, domainUid, adminServerPodName, clusterViewAppPath),
528+
getLogger(),
529+
"deploying application {0} to pod {1} in namespace {2} succeeds",
530+
clusterViewAppPath,
531+
adminServerPodName,
532+
domainNamespace);
529533
}
530534
}
531535

532-
private static void deployApplication(String namespace, String domainUid, String adminServerPodName,
536+
private static boolean deployApplication(String namespace, String domainUid, String adminServerPodName,
533537
Path clusterViewAppPath) {
534538
getLogger().info("Getting node port for admin server default channel");
535539
int serviceNodePort = assertDoesNotThrow(() ->
@@ -545,7 +549,7 @@ private static void deployApplication(String namespace, String domainUid, String
545549
targets, clusterViewAppPath, null, domainUid + "clusterview");
546550
assertNotNull(result, "Application deployment failed");
547551
getLogger().info("Application deployment returned {0}", result.toString());
548-
assertEquals("202", result.stdout(), "Deployment didn't return HTTP status code 202");
552+
return result.stdout().equals("202");
549553
}
550554

551555
/**

0 commit comments

Comments
 (0)