Skip to content

Commit 0344d5a

Browse files
authored
Fixed [wko-nightly] ItFmwDynamicClusterMiiDomain test class failing intermittently (#3576)
1 parent c8d2ae0 commit 0344d5a

File tree

1 file changed

+17
-0
lines changed
  • integration-tests/src/test/java/oracle/weblogic/kubernetes/utils

1 file changed

+17
-0
lines changed

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

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,12 @@ public static synchronized void startOracleDB(String dbBaseImageName, int dbPort
281281
}
282282

283283
// wait for the Oracle DB pod to be ready
284+
testUntil(
285+
assertDoesNotThrow(() -> checkDBPodNameReady(dbNamespace, dbPodNamePrefix),
286+
String.format("DB pod %s is not ready yet in namespace %s", dbPodNamePrefix, dbNamespace)),
287+
logger,
288+
"Oracle DB pod to be ready in namespace {0}", dbNamespace);
289+
284290
String dbPodName = assertDoesNotThrow(() -> getPodNameOfDb(dbNamespace, dbPodNamePrefix),
285291
String.format("Get Oracle DB pod name failed with ApiException for oracleDBService in namespace %s",
286292
dbNamespace));
@@ -301,6 +307,17 @@ public static synchronized void startOracleDB(String dbBaseImageName, int dbPort
301307
dbMap.put(dbNamespace, dbPodName);
302308
}
303309

310+
private static Callable<Boolean> checkDBPodNameReady(String dbNamespace, String dbPodNamePrefix) {
311+
return (() -> {
312+
// wait for the Oracle DB pod to be ready
313+
String dbPodName = assertDoesNotThrow(() -> getPodNameOfDb(dbNamespace, dbPodNamePrefix),
314+
String.format("Get Oracle DB pod name failed with ApiException for oracleDBService in namespace %s",
315+
dbNamespace));
316+
317+
return (dbPodName != null);
318+
});
319+
}
320+
304321
/**
305322
* Create a RCU schema in the namespace.
306323
*

0 commit comments

Comments
 (0)