This is an automated email from the ASF dual-hosted git repository.

twalthr pushed a commit to branch release-1.12
in repository https://gitbox.apache.org/repos/asf/flink.git


The following commit(s) were added to refs/heads/release-1.12 by this push:
     new b2c29a7  [FLINK-17424][e2e] Further stabilize Elasticsearch downloads
b2c29a7 is described below

commit b2c29a7a6918845c5b2b81a92f60cf1399ac3885
Author: Timo Walther <[email protected]>
AuthorDate: Tue Nov 24 14:34:53 2020 +0100

    [FLINK-17424][e2e] Further stabilize Elasticsearch downloads
    
    This aims to solve different issues while downloading Elasticsearch
    binaries. We use wget (specialized in downloading) in the hope for
    more stability. Furthermore, we implement a retry logic ourselves
    which includes the successful tar archive extraction in case of
    corrupt downloads.
    
    This closes #14202.
---
 .../test-scripts/elasticsearch-common.sh             | 20 ++++++++++++++++----
 .../test-scripts/test_sql_client.sh                  |  5 +++--
 2 files changed, 19 insertions(+), 6 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 0d2e83e..f231dd2 100644
--- a/flink-end-to-end-tests/test-scripts/elasticsearch-common.sh
+++ b/flink-end-to-end-tests/test-scripts/elasticsearch-common.sh
@@ -34,12 +34,24 @@ function setup_elasticsearch {
     fi
 
     # start downloading Elasticsearch
-    echo "Downloading Elasticsearch from $downloadUrl ..."
-    curl "$downloadUrl" --retry 10 --retry-max-time 120 --output 
$TEST_DATA_DIR/elasticsearch.tar.gz
-
     local elasticsearchDir=$TEST_DATA_DIR/elasticsearch
     mkdir -p $elasticsearchDir
-    tar xzf $TEST_DATA_DIR/elasticsearch.tar.gz -C $elasticsearchDir 
--strip-components=1
+    echo "Downloading Elasticsearch from $downloadUrl ..."
+    for i in {1..10};
+    do
+        wget "$downloadUrl" -O $TEST_DATA_DIR/elasticsearch.tar.gz
+        if [ $? -eq 0 ]; then
+            echo "Download successful."
+            echo "Extracting..."
+            tar xzf $TEST_DATA_DIR/elasticsearch.tar.gz -C $elasticsearchDir 
--strip-components=1
+            if [ $? -eq 0 ]; then
+                break
+            fi
+        fi
+        echo "Attempt $i failed."
+        sleep 5
+    done
+    echo "Extraction successful."
 
     if [ `uname -i` == 'aarch64' ] && [ $elasticsearch_version -ge 6 ]; then
       echo xpack.ml.enabled: false >> 
$elasticsearchDir/config/elasticsearch.yml
diff --git a/flink-end-to-end-tests/test-scripts/test_sql_client.sh 
b/flink-end-to-end-tests/test-scripts/test_sql_client.sh
index 5899ce1..37bbd38 100755
--- a/flink-end-to-end-tests/test-scripts/test_sql_client.sh
+++ b/flink-end-to-end-tests/test-scripts/test_sql_client.sh
@@ -26,8 +26,9 @@ CONFLUENT_VERSION="5.0.0"
 CONFLUENT_MAJOR_VERSION="5.0"
 KAFKA_SQL_VERSION="universal"
 ELASTICSEARCH_VERSION=7
-ELASTICSEARCH_MAC_DOWNLOAD_URL='https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.5.1-darwin-x86_64.tar.gz'
-ELASTICSEARCH_LINUX_DOWNLOAD_URL='https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.5.1-linux-x86_64.tar.gz'
+# we use the smallest version possible
+ELASTICSEARCH_MAC_DOWNLOAD_URL='https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-oss-7.5.1-no-jdk-darwin-x86_64.tar.gz'
+ELASTICSEARCH_LINUX_DOWNLOAD_URL='https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-oss-7.5.1-no-jdk-linux-x86_64.tar.gz'
 
 source "$(dirname "$0")"/common.sh
 source "$(dirname "$0")"/kafka_sql_common.sh \

Reply via email to