diff --git a/qa/vagrant/src/test/resources/packaging/tests/bootstrap_password.bash b/qa/vagrant/src/test/resources/packaging/tests/bootstrap_password.bash index a385abd6d2f..7c2a42c373b 100644 --- a/qa/vagrant/src/test/resources/packaging/tests/bootstrap_password.bash +++ b/qa/vagrant/src/test/resources/packaging/tests/bootstrap_password.bash @@ -95,6 +95,7 @@ SETUP_OK [ "$status" -eq 0 ] || { echo "Expected x-pack setup-passwords tool exit code to be zero but got [$status]" cat /tmp/setup-passwords-output-with-bootstrap + debug_collect_logs false } diff --git a/qa/vagrant/src/test/resources/packaging/tests/certgen.bash b/qa/vagrant/src/test/resources/packaging/tests/certgen.bash index 87b77f3572e..313fbd97374 100644 --- a/qa/vagrant/src/test/resources/packaging/tests/certgen.bash +++ b/qa/vagrant/src/test/resources/packaging/tests/certgen.bash @@ -261,6 +261,7 @@ MASTER_SETTINGS [ "$status" -eq 0 ] || { echo "Failed to connect to master node using HTTPS:" echo "$output" + debug_collect_logs false } echo "$output" | grep "node-master" @@ -359,6 +360,7 @@ DATA_SETTINGS -XPOST "https://127.0.0.1:9200/books/book/0?refresh" \ -d '{"title": "Elasticsearch The Definitive Guide"}') + debug_collect_logs echo "$testIndex" | grep '"result":"created"' masterSettings=$(sudo curl -u "elastic:changeme" \ diff --git a/qa/vagrant/src/test/resources/packaging/utils/xpack.bash b/qa/vagrant/src/test/resources/packaging/utils/xpack.bash index 33a8acfd2b7..435d60233a9 100644 --- a/qa/vagrant/src/test/resources/packaging/utils/xpack.bash +++ b/qa/vagrant/src/test/resources/packaging/utils/xpack.bash @@ -96,12 +96,19 @@ assert_number_of_files() { wait_for_xpack() { local host=${1:-localhost} local port=${2:-9200} - - local waitFor + local listening=1 for i in {1..60}; do - waitFor=$(echo "GET / HTTP/1.0" > /dev/tcp/$host/$port; echo $?) - [ "$waitFor" -eq "0" ] && break || sleep 1; + if test_port "$host" "$port"; then + listening=0 + break + else + sleep 1 + fi done - [ "$waitFor" -eq "0" ] + [ "$listening" -eq 0 ] || { + echo "Looks like elasticsearch with x-pack never started." + debug_collect_logs + false + } }