From d946ec5f130c4d3ffaa0e9b8d9abd35ba3224661 Mon Sep 17 00:00:00 2001 From: zentol Date: Thu, 8 Nov 2018 13:09:22 +0100 Subject: [PATCH] [FLINK-10361][tests][ES] Properly wait for ES to start This closes #7057. --- flink-end-to-end-tests/test-scripts/elasticsearch-common.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flink-end-to-end-tests/test-scripts/elasticsearch-common.sh b/flink-end-to-end-tests/test-scripts/elasticsearch-common.sh index 16689c8a3f880..8bb9c42ab69cd 100644 --- a/flink-end-to-end-tests/test-scripts/elasticsearch-common.sh +++ b/flink-end-to-end-tests/test-scripts/elasticsearch-common.sh @@ -43,10 +43,10 @@ function wait_elasticsearch_working { echo "Waiting for Elasticsearch node to work..." for ((i=1;i<=60;i++)); do - curl -XGET 'http://localhost:9200' || true + output=$(curl -XGET 'http://localhost:9200' | grep "cluster_name" || true) # make sure the elasticsearch node is actually working - if [ $? -ne 0 ]; then + if [ "${output}" = "" ]; then sleep 1 else echo "Elasticsearch node is working."