You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by ar...@apache.org on 2021/12/01 09:35:35 UTC

[flink] branch master updated: [FLINK-25092][tests][elasticsearch] Refactor test to use artifact cacher

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

arvid pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git


The following commit(s) were added to refs/heads/master by this push:
     new 5eeef83  [FLINK-25092][tests][elasticsearch] Refactor test to use artifact cacher
5eeef83 is described below

commit 5eeef8371ed0e726f737547bfd888d0d66cb3ab5
Author: martijnvisser <ma...@2symbols.com>
AuthorDate: Tue Nov 30 15:40:37 2021 +0100

    [FLINK-25092][tests][elasticsearch] Refactor test to use artifact cacher
---
 .../test-scripts/elasticsearch-common.sh            | 21 +++++++--------------
 1 file changed, 7 insertions(+), 14 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 e69306b..f860505 100644
--- a/flink-end-to-end-tests/test-scripts/elasticsearch-common.sh
+++ b/flink-end-to-end-tests/test-scripts/elasticsearch-common.sh
@@ -22,6 +22,8 @@ if [[ -z $TEST_DATA_DIR ]]; then
   exit 1
 fi
 
+source "$(dirname "$0")"/common_artifact_download_cacher.sh
+
 function setup_elasticsearch {
     mkdir -p $TEST_DATA_DIR
 
@@ -37,20 +39,11 @@ function setup_elasticsearch {
     local elasticsearchDir=$TEST_DATA_DIR/elasticsearch
     mkdir -p $elasticsearchDir
     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
+    cache_path=$(get_artifact $downloadUrl)
+    ln "$cache_path" "${TEST_DATA_DIR}/elasticsearch.tar.gz"
+    echo "Download successful."
+    echo "Extracting..."
+    tar xzf $TEST_DATA_DIR/elasticsearch.tar.gz -C $elasticsearchDir --strip-components=1
     echo "Extraction successful."
 
     if [ `uname -i` == 'aarch64' ] && [ $elasticsearch_version -ge 6 ]; then