Skip to content

Commit 311af01

Browse files
authored
Fixed intermittent failures in MonExporter due failure to download webapp war file (#2625)
* Fixed intermittent failures in MonExporter due failure to download webapp war file
1 parent 8334647 commit 311af01

File tree

2 files changed

+26
-14
lines changed

2 files changed

+26
-14
lines changed

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

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -664,16 +664,20 @@ public static boolean isDeploymentReady(String deploymentName,
664664
boolean status = false;
665665
V1Deployment deployment = getDeployment(deploymentName, label, namespace);
666666

667-
V1DeploymentCondition v1DeploymentRunningCondition = Optional.ofNullable(deployment)
667+
List<V1DeploymentCondition> deplList = Optional.ofNullable(deployment)
668668
.map(V1Deployment::getStatus).map(V1DeploymentStatus::getConditions)
669-
.orElse(null).stream()
670-
.filter(v1DeploymentCondition -> "Available".equals(v1DeploymentCondition.getType()))
671-
.findAny()
672669
.orElse(null);
673-
if (v1DeploymentRunningCondition != null) {
674-
status = v1DeploymentRunningCondition.getStatus().equalsIgnoreCase("true");
675-
} else {
676-
getLogger().info("Can't check deployment status");
670+
if (deplList != null) {
671+
V1DeploymentCondition v1DeploymentRunningCondition = deplList.stream()
672+
.filter(v1DeploymentCondition -> "Available".equals(v1DeploymentCondition.getType()))
673+
.findAny()
674+
.orElse(null);
675+
676+
if (v1DeploymentRunningCondition != null) {
677+
status = v1DeploymentRunningCondition.getStatus().equalsIgnoreCase("true");
678+
} else {
679+
getLogger().info("Can't check deployment status");
680+
}
677681
}
678682
return status;
679683
}

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

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -134,20 +134,28 @@ public static void downloadMonitoringExporterApp(String configFile, String appli
134134
.command(command))
135135
.execute(), "Failed to download monitoring exporter webapp");
136136

137-
command = String.format("cd %s && %s %s",
137+
String command1 = String.format("cd %s && %s %s",
138138
applicationDir,
139139
monitoringExporterBuildFile,
140140
configFile);
141-
assertTrue(new Command()
142-
.withParams(new CommandParams()
143-
.command(command))
144-
.execute(), "Failed to build monitoring exporter webapp");
141+
142+
testUntil(
143+
(() -> new Command()
144+
.withParams(
145+
new CommandParams()
146+
.verbose(true)
147+
.command(command1))
148+
.executeAndVerify("adding: config.yml")
149+
),
150+
logger,
151+
"Downloading monitoring exporter webapp");
152+
145153
assertDoesNotThrow(() -> checkFile(applicationDir + "/wls-exporter.war"),
146154
"Monitoring Exporter web application file was not found");
147155
}
148156

149157
/**
150-
* Build monitoring exporter web applicaiont wls-exporter.war with provided configuration
158+
* Build monitoring exporter web applicaiont wls-exporter.war with provided configuration
151159
* @param monitoringExporterSrcDir directory containing github monitoring exporter
152160
* @param configFile configuration file for weblogic domain monitoring
153161
* @param appDir directory where war file will be created

0 commit comments

Comments
 (0)