From dc4c8c269344b4ed9c46c39d50cb51e19257fa14 Mon Sep 17 00:00:00 2001 From: Boaz Leskes Date: Mon, 16 Mar 2015 12:14:33 -0700 Subject: [PATCH] Tests: improve logging of external node version and build The BWC tests also run against a snapshot build of previous release branches. Upon a failure it's important to know what commit exactly was used. Closes #10111 --- src/main/java/org/elasticsearch/Build.java | 5 +++++ src/test/java/org/elasticsearch/test/ExternalNode.java | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/elasticsearch/Build.java b/src/main/java/org/elasticsearch/Build.java index d7e6b816cc5..cf3b7de05a6 100644 --- a/src/main/java/org/elasticsearch/Build.java +++ b/src/main/java/org/elasticsearch/Build.java @@ -93,4 +93,9 @@ public class Build { out.writeString(build.hashShort()); out.writeString(build.timestamp()); } + + @Override + public String toString() { + return "[" + hash + "][" + timestamp + "]"; + } } diff --git a/src/test/java/org/elasticsearch/test/ExternalNode.java b/src/test/java/org/elasticsearch/test/ExternalNode.java index 45f543cf82b..69d7e886b3f 100644 --- a/src/test/java/org/elasticsearch/test/ExternalNode.java +++ b/src/test/java/org/elasticsearch/test/ExternalNode.java @@ -46,7 +46,6 @@ import java.util.Map; import java.util.Random; import java.util.concurrent.TimeUnit; -import static junit.framework.Assert.assertFalse; import static org.elasticsearch.common.settings.ImmutableSettings.settingsBuilder; /** @@ -136,12 +135,13 @@ final class ExternalNode implements Closeable { builder.inheritIO(); boolean success = false; try { - logger.debug("starting external node [{}] with: {}", nodeName, builder.command()); + logger.info("starting external node [{}] with: {}", nodeName, builder.command()); process = builder.start(); this.nodeInfo = null; if (waitForNode(client, nodeName)) { nodeInfo = nodeInfo(client, nodeName); assert nodeInfo != null; + logger.info("external node {} found, version [{}], build {}", nodeInfo.getNode(), nodeInfo.getVersion(), nodeInfo.getBuild()); } else { throw new IllegalStateException("Node [" + nodeName + "] didn't join the cluster"); }