This is an automated email from the ASF dual-hosted git repository.

orpiske pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/main by this push:
     new 5b98f84  CAMEL-16698: do log when unable to determine docker 
availability (#5634)
5b98f84 is described below

commit 5b98f840ccacefa8d512c1ae3e814d88cab37ca8
Author: Otavio Rodolfo Piske <[email protected]>
AuthorDate: Thu Jun 10 12:32:35 2021 +0200

    CAMEL-16698: do log when unable to determine docker availability (#5634)
---
 components/pom.xml                                           |  2 +-
 .../test/infra/common/services/ContainerEnvironmentUtil.java | 12 +++++++++---
 .../camel/test/infra/common/services/ContainerService.java   |  5 ++++-
 3 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/components/pom.xml b/components/pom.xml
index eaa75f9..1736939 100644
--- a/components/pom.xml
+++ b/components/pom.xml
@@ -380,7 +380,7 @@
                     <configuration>
                         <reuseForks>true</reuseForks>
                         
<forkedProcessTimeoutInSeconds>300</forkedProcessTimeoutInSeconds>
-                        
<redirectTestOutputToFile>true</redirectTestOutputToFile>
+                        
<redirectTestOutputToFile>false</redirectTestOutputToFile>
                         <systemPropertyVariables>
                             
<visibleassertions.silence>true</visibleassertions.silence>
                         </systemPropertyVariables>
diff --git 
a/test-infra/camel-test-infra-common/src/test/java/org/apache/camel/test/infra/common/services/ContainerEnvironmentUtil.java
 
b/test-infra/camel-test-infra-common/src/test/java/org/apache/camel/test/infra/common/services/ContainerEnvironmentUtil.java
index 15b82df..a5964bb 100644
--- 
a/test-infra/camel-test-infra-common/src/test/java/org/apache/camel/test/infra/common/services/ContainerEnvironmentUtil.java
+++ 
b/test-infra/camel-test-infra-common/src/test/java/org/apache/camel/test/infra/common/services/ContainerEnvironmentUtil.java
@@ -33,9 +33,15 @@ public final class ContainerEnvironmentUtil {
 
     public static synchronized boolean isDockerAvailable() {
         if (!environmentCheckState) {
-            dockerAvailable = 
DockerClientFactory.instance().isDockerAvailable();
-            if (!dockerAvailable) {
-                LOG.warn("Docker environment is not available");
+            try {
+                dockerAvailable = 
DockerClientFactory.instance().isDockerAvailable();
+                if (!dockerAvailable) {
+                    LOG.warn("Docker environment is not available");
+                }
+            } catch (Exception e) {
+                LOG.error("Failed to evaluate whether the docker environment 
is available: {}", e.getMessage(), e);
+                LOG.warn("Turning off container-based tests because docker 
does not seem to be working correctly");
+                dockerAvailable = false;
             }
 
             environmentCheckState = true;
diff --git 
a/test-infra/camel-test-infra-common/src/test/java/org/apache/camel/test/infra/common/services/ContainerService.java
 
b/test-infra/camel-test-infra-common/src/test/java/org/apache/camel/test/infra/common/services/ContainerService.java
index 4c7f68f..0d01af2 100644
--- 
a/test-infra/camel-test-infra-common/src/test/java/org/apache/camel/test/infra/common/services/ContainerService.java
+++ 
b/test-infra/camel-test-infra-common/src/test/java/org/apache/camel/test/infra/common/services/ContainerService.java
@@ -34,7 +34,10 @@ public interface ContainerService<T extends 
GenericContainer> extends ExecutionC
         }
 
         Logger logger = LoggerFactory.getLogger(ContainerService.class);
-        logger.warn("Test {} disabled because docker is not available", 
extensionContext.getElement().orElse(null));
+        logger.warn("Test {} is disabled because docker is not available", 
extensionContext.getElement().orElse(null));
+
+        System.err.println(
+                "Container-based tests were disabled because Docker is NOT 
available. Check the log files on target/failsafe-reports");
         return ConditionEvaluationResult.disabled("Docker is NOT available");
     }
 

Reply via email to