use of com.microsoft.applicationinsights.smoketest.docker.ContainerInfo in project ApplicationInsights-Java by microsoft.
the class AiSmokeTest method waitForApplicationToStart.
protected static void waitForApplicationToStart() throws Exception {
ContainerInfo containerInfo = currentContainerInfo.get();
try {
System.out.printf("Test app health check: Waiting for %s to start...%n", warFileName);
String contextRootUrl = getBaseUrl() + "/";
waitForUrlWithRetries(contextRootUrl, APPLICATION_READY_TIMEOUT_SECONDS, TimeUnit.SECONDS, String.format("%s on %s", getAppContext(), containerInfo.getImageName()), HEALTH_CHECK_RETRIES);
System.out.println("Test app health check complete.");
waitForHealthCheckTelemetryIfNeeded(contextRootUrl);
} catch (Exception e) {
for (ContainerInfo container : allContainers) {
System.out.println("========== dumping container log: " + container.getContainerId());
AiDockerClient.printContainerLogs(container.getContainerId());
System.out.println("end of container log ==========");
}
throw e;
} finally {
mockedIngestion.resetData();
}
}
Aggregations