[Tests] Add more time to start with X-Pack

This commit adds a bit more time to the packaging tests to start when
x-pack is installed.

Original commit: elastic/x-pack-elasticsearch@228a3d7c33
This commit is contained in:
Tanguy Leroux 2018-02-12 11:35:46 +01:00
parent f4fa274aa8
commit 8e501b6a7e

View File

@ -96,7 +96,12 @@ assert_number_of_files() {
wait_for_xpack() {
local host=${1:-localhost}
local port=${2:-9200}
for i in {1..30}; do
echo "GET / HTTP/1.0" > /dev/tcp/$host/$port && break || sleep 1;
local waitFor
for i in {1..60}; do
waitFor=$(echo "GET / HTTP/1.0" > /dev/tcp/$host/$port; echo $?)
[ "$waitFor" -eq "0" ] && break || sleep 1;
done
[ "$waitFor" -eq "0" ]
}