Skip to content

Commit 5f36312

Browse files
authored
Added test for retry improvements to cover introspect failure retry count exceeded error msg to domain status failure msg (#3716)
1 parent 4d6891d commit 5f36312

File tree

2 files changed

+19
-4
lines changed

2 files changed

+19
-4
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,11 +404,15 @@ void testRetryOccursAndErrorFromIntrospectorLoggedInOperator() throws Exception
404404
testUntil(() -> checkPodLogContainsRegex(createDomainFailedMsgRegex, operatorPodName, opNamespace),
405405
logger, "{0} is found in Operator log", createDomainFailedMsgRegex);
406406

407-
// verify that SEVERE and createDomainFailedMsgRegex message found in Operator log
407+
// verify that SEVERE and createDomainFailedMsgRegex message found in introspector log
408408
testUntil(() -> checkInUncompletedIntroPodLogContainsRegex(createDomainFailedMsgRegex,
409409
domainUid, domainNamespace),
410410
logger, "{0} is found in introspector log", createDomainFailedMsgRegex);
411411

412+
// verify that SEVERE and createDomainFailedMsgRegex message found in domain status
413+
testUntil(() -> findStringInDomainStatusMessage(domainNamespace, domainUid, createDomainFailedMsgRegex, "true"),
414+
logger, "{0} is found in domain status message", createDomainFailedMsgRegex);
415+
412416
Callable<Boolean> configMapExist = assertDoesNotThrow(() -> configMapExist(domainNamespace, badModelFileCm));
413417

414418
if (configMapExist.call().booleanValue()) {

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

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1212,14 +1212,25 @@ public static DomainResource getAndValidateInitialDomain(String domainNamespace,
12121212
* @return true if regex found, false otherwise.
12131213
*/
12141214
@Nonnull
1215-
public static boolean findStringInDomainStatusMessage(String domainNamespace, String domainUid, String regex) {
1215+
public static boolean findStringInDomainStatusMessage(String domainNamespace,
1216+
String domainUid,
1217+
String regex,
1218+
String... multupleMessage) {
12161219
// get the domain status message
12171220
StringBuffer getDomainInfoCmd = new StringBuffer(KUBERNETES_CLI + " get domain/");
12181221
getDomainInfoCmd
12191222
.append(domainUid)
12201223
.append(" -n ")
1221-
.append(domainNamespace)
1222-
.append(" -o jsonpath='{.status.message}' --ignore-not-found");
1224+
.append(domainNamespace);
1225+
1226+
if (multupleMessage.length == 0) {
1227+
// get single field of domain message
1228+
getDomainInfoCmd.append(" -o jsonpath='{.status.message}' --ignore-not-found");
1229+
} else {
1230+
// use [,] to get side by side multiple fields of the domain status message
1231+
getDomainInfoCmd.append(" -o jsonpath=\"{.status.conditions[*]['status', 'message']}\" --ignore-not-found");
1232+
}
1233+
12231234
getLogger().info("Command to get domain status message: " + getDomainInfoCmd);
12241235

12251236
CommandParams params = new CommandParams().defaults();

0 commit comments

Comments
 (0)