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 16:27:17 UTC
[flink] branch release-1.13 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 release-1.13
in repository https://gitbox.apache.org/repos/asf/flink.git
The following commit(s) were added to refs/heads/release-1.13 by this push:
new 217bc9c [FLINK-25092][tests][elasticsearch] Refactor test to use artifact cacher
217bc9c is described below
commit 217bc9c426f26eb3ca0bfd2103764e7edac26f45
Author: martijnvisser <ma...@2symbols.com>
AuthorDate: Tue Nov 30 15:40:37 2021 +0100
[FLINK-25092][tests][elasticsearch] Refactor test to use artifact cacher
(cherry picked from commit 5eeef8371ed0e726f737547bfd888d0d66cb3ab5)
---
.../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 f231dd2..b932ceb 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