Skip to content

Commit 3b85b9c

Browse files
hzhao-githubrjeberhard
authored andcommitted
ItWlsDomainOnPV.testOperatorCreatesPvPvcWlsDomain fails intermittently on main
1 parent f6e8fe1 commit 3b85b9c

File tree

1 file changed

+18
-2
lines changed
  • integration-tests/src/test/java/oracle/weblogic/kubernetes/assertions/impl

1 file changed

+18
-2
lines changed

integration-tests/src/test/java/oracle/weblogic/kubernetes/assertions/impl/Kubernetes.java

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,9 @@ public static V1Service getService(
583583
labelSelector = String.format("%s in (%s)", key, value);
584584
logger.info(labelSelector);
585585
}
586-
V1ServiceList v1ServiceList
586+
V1ServiceList v1ServiceList = null;
587+
try {
588+
v1ServiceList
587589
= coreV1Api.listServiceForAllNamespaces(
588590
Boolean.FALSE, // allowWatchBookmarks requests watch events with type "BOOKMARK".
589591
null, // continue to query when there is more results to return.
@@ -596,7 +598,20 @@ public static V1Service getService(
596598
SEND_INITIAL_EVENTS_UNSET, // Boolean | if to send initial events
597599
null, // Timeout for the list/watch call.
598600
Boolean.FALSE // Watch for changes to the described resources.
599-
);
601+
);
602+
} catch (ApiException aex) {
603+
logger.info("Failed to check whether service {0} in namespace {1} exists! Caught ApiException!",
604+
serviceName, namespace);
605+
logger.info("Printing aex.getCode:");
606+
aex.getCode();
607+
logger.info("Printing aex.getResponseBody:");
608+
aex.getResponseBody();
609+
logger.info("Printing aex.printStackTrace:");
610+
aex.printStackTrace();
611+
612+
return null;
613+
}
614+
600615
for (V1Service service : v1ServiceList.getItems()) {
601616
if (service.getMetadata().getName().equals(serviceName.trim())
602617
&& service.getMetadata().getNamespace().equals(namespace.trim())) {
@@ -612,6 +627,7 @@ public static V1Service getService(
612627
return service;
613628
}
614629
}
630+
615631
return null;
616632
}
617633

0 commit comments

Comments
 (0)