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 5415a80  [FLINK-24971][tests] Adding retry function for failures in 
Bash e2e tests
5415a80 is described below

commit 5415a800aeadf4bf8065a40429606b205afc02a4
Author: martijnvisser <[email protected]>
AuthorDate: Wed Nov 24 10:01:28 2021 +0100

    [FLINK-24971][tests] Adding retry function for failures in Bash e2e tests
---
 flink-end-to-end-tests/test-scripts/common.sh     | 21 +++++++++++++++++++++
 flink-end-to-end-tests/test-scripts/common_ssl.sh |  3 ++-
 2 files changed, 23 insertions(+), 1 deletion(-)

diff --git a/flink-end-to-end-tests/test-scripts/common.sh 
b/flink-end-to-end-tests/test-scripts/common.sh
index bac8648..c7860d5 100644
--- a/flink-end-to-end-tests/test-scripts/common.sh
+++ b/flink-end-to-end-tests/test-scripts/common.sh
@@ -819,6 +819,27 @@ function retry_times_with_backoff_and_cleanup() {
     return 1
 }
 
+function retry_times_with_exponential_backoff {
+  local retries=$1
+  shift
+
+  local count=0
+  echo "Executing command:" "$@"
+  until "$@"; do
+    exit=$?
+    wait=$((2 ** $count))
+    count=$(($count + 1))
+    if [ $count -lt $retries ]; then
+      echo "Retry $count/$retries exited $exit, retrying in $wait seconds..."
+      sleep $wait
+    else
+      echo "Retry $count/$retries exited $exit, no more retries left."
+      return $exit
+    fi
+  done
+  return 0
+}
+
 JOB_ID_REGEX_EXTRACTOR=".*JobID ([0-9,a-f]*)"
 
 function extract_job_id_from_job_submission_return() {
diff --git a/flink-end-to-end-tests/test-scripts/common_ssl.sh 
b/flink-end-to-end-tests/test-scripts/common_ssl.sh
index f9e618e..2a2c7f1 100644
--- a/flink-end-to-end-tests/test-scripts/common_ssl.sh
+++ b/flink-end-to-end-tests/test-scripts/common_ssl.sh
@@ -77,7 +77,8 @@ function _set_conf_ssl_helper {
         # -> we need to build it ourselves
         FLINK_SHADED_VERSION=$(cat ${END_TO_END_DIR}/../pom.xml | sed -n 
's/.*<flink.shaded.version>\(.*\)<\/flink.shaded.version>/\1/p')
         echo "BUILDING flink-shaded-netty-tcnative-static"
-        git clone https://github.com/apache/flink-shaded.git
+        # Adding retry to git clone, due to FLINK-24971
+        retry_times_with_exponential_backoff 5 git clone 
https://github.com/apache/flink-shaded.git
         cd flink-shaded
         git checkout "release-${FLINK_SHADED_VERSION}"
         run_mvn clean package -Pinclude-netty-tcnative-static -pl 
flink-shaded-netty-tcnative-static

Reply via email to