fail with better error message if elasticsearch was started already

Before it failed with
.../es/qa/smoke-test-plugins/target/integ-tests/es.pid doesn't exist
which was confusing.
This commit is contained in:
Britta Weber 2015-08-18 17:38:06 +02:00
parent 20851a4e4a
commit 4cc6359756
1 changed files with 8 additions and 0 deletions

View File

@ -157,6 +157,14 @@
<attribute name="jvm.args" default="${tests.jvm.argline}"/>
<element name="additional-args" optional="true"/>
<sequential>
<!-- make sure no elasticsearch instance is currently running and listening on the port we need -->
<fail message="This test expects port @{es.http.port} to be free but an elasticsearch instance is already running and listening on that port.
Maybe the last test run did not manage to shut down the node correctly?
You must kill it before tests can run.">
<condition>
<socket server="localhost" port="@{es.http.port}"></socket>
</condition>
</fail>
<!-- run bin/elasticsearch with args -->
<echo>Starting up external cluster...</echo>