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/11/26 14:17:36 UTC

[flink] branch release-1.12 updated: [FLINK-24971][tests] Adding retry function for failures in Bash e2e tests

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

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

commit 5972c7f040b6e683afc60b7703512eb2a1d089ef
Author: martijnvisser <ma...@2symbols.com>
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 19cf908..834cb37 100644
--- a/flink-end-to-end-tests/test-scripts/common.sh
+++ b/flink-end-to-end-tests/test-scripts/common.sh
@@ -791,6 +791,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