From b1aac9fcb678ca11a0a0fbe3d5900cec1069c1c1 Mon Sep 17 00:00:00 2001 From: Ashhar Hasan Date: Mon, 31 Oct 2022 19:58:28 +0530 Subject: [PATCH] Include container healthcheck logs for unhealthy containers The product tests fail the environment startup if all containers are not healthy and log the name of the unhealthy container. Since the logs don't include the healthcheck logs from Docker it's impossible to find why the container appeared unhealthy. This change additionally logs the healthcheck responses from the Docker daemon for unhealhty containers. --- .../java/io/trino/tests/product/launcher/env/Environment.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/trino-product-tests-launcher/src/main/java/io/trino/tests/product/launcher/env/Environment.java b/testing/trino-product-tests-launcher/src/main/java/io/trino/tests/product/launcher/env/Environment.java index 368f7c1be3eb..d38fc11b9787 100644 --- a/testing/trino-product-tests-launcher/src/main/java/io/trino/tests/product/launcher/env/Environment.java +++ b/testing/trino-product-tests-launcher/src/main/java/io/trino/tests/product/launcher/env/Environment.java @@ -349,7 +349,7 @@ private static boolean containerIsHealthy(DockerContainer container) } if (!container.isHealthy()) { - log.warn("Container %s is not healthy", container.getLogicalName()); + log.warn("Container %s is not healthy, logs of container healthcheck:\n%s", container.getLogicalName(), container.getCurrentContainerInfo().getState().getHealth().getLog()); return false; }