Browse Source

Fix DockerTests.dumpDebug to read the container logs (#108652)

This commit overrides dumpDebug for DockerTests to pull the log from
docker rather than looking in the filesystem.
Ryan Ernst 1 year ago
parent
commit
b37d9358e7

+ 7 - 0
qa/packaging/src/test/java/org/elasticsearch/packaging/test/DockerTests.java

@@ -126,6 +126,13 @@ public class DockerTests extends PackagingTestCase {
         rm(tempDir);
     }
 
+    @Override
+    protected void dumpDebug() {
+        final Result containerLogs = getContainerLogs();
+        logger.warn("Elasticsearch log stdout:\n" + containerLogs.stdout());
+        logger.warn("Elasticsearch log stderr:\n" + containerLogs.stderr());
+    }
+
     /**
      * Checks that the Docker image can be run, and that it passes various checks.
      */