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
This commit is contained in:
Boaz Leskes 2015-03-16 12:14:33 -07:00
parent a1f5c342af
commit dc4c8c2693
2 changed files with 7 additions and 2 deletions

View File

@ -93,4 +93,9 @@ public class Build {
out.writeString(build.hashShort());
out.writeString(build.timestamp());
}
@Override
public String toString() {
return "[" + hash + "][" + timestamp + "]";
}
}

View File

@ -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");
}