You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by el...@apache.org on 2019/12/29 10:27:50 UTC

svn commit: r1872073 - /httpd/httpd/trunk/test/travis_before_linux.sh

Author: elukey
Date: Sun Dec 29 10:27:50 2019
New Revision: 1872073

URL: http://svn.apache.org/viewvc?rev=1872073&view=rev
Log:
test/travis_before_linux.sh: move retry logic to function

Move the retry logic to a bash function and restore the -e
failure policy in the script (to have cleaner log traces
in base of build failures).


Modified:
    httpd/httpd/trunk/test/travis_before_linux.sh

Modified: httpd/httpd/trunk/test/travis_before_linux.sh
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/test/travis_before_linux.sh?rev=1872073&r1=1872072&r2=1872073&view=diff
==============================================================================
--- httpd/httpd/trunk/test/travis_before_linux.sh (original)
+++ httpd/httpd/trunk/test/travis_before_linux.sh Sun Dec 29 10:27:50 2019
@@ -1,22 +1,33 @@
-#!/bin/bash -x
-if ! test -v SKIP_TESTING; then
-   # Use a rudimental retry workflow as workaround to svn export hanging for minutes.
-   # Travis automatically kills a build if one step takes more than 10 minutes without
-   # reporting any progress.
-   for i in {1..5} 
+#!/bin/bash -xe
+
+# Use a rudimental retry workflow as workaround to svn export hanging for minutes.
+# Travis automatically kills a build if one step takes more than 10 minutes without
+# reporting any progress. 
+function run_svn_export() {
+   local url=$1
+   local dest_dir=$2
+   local max_tries=$3
+
+   # Disable -e to allow fail/retry
+   set +e
+
+   for i in $(seq 1 $max_tries)
    do
-       timeout 60 svn export --force -q https://svn.apache.org/repos/asf/httpd/test/framework/trunk test/perl-framework
+       timeout 60 svn export --force -q $url $dest_dir
        if [ $? -eq 0 ]; then
            break
        else
-           if [ $i -eq 5 ]; then
+           if [ $i -eq $max_tries ]; then
                exit 1
            else
                sleep 120
            fi
        fi
    done
-fi
+
+   # Restore -e behavior after fail/retry
+   set -e
+}
 
 function install_apx() {
     local name=$1
@@ -54,6 +65,11 @@ function install_apx() {
     touch ${prefix}/.revision-is-${revision}
 }
 
+
+if ! test -v SKIP_TESTING; then
+    run_svn_export https://svn.apache.org/repos/asf/httpd/test/framework/trunk test/perl-framework 5
+fi
+
 if test -v APR_VERSION; then
     install_apx apr ${APR_VERSION} "${APR_CONFIG}"
     APU_CONFIG="$APU_CONFIG --with-apr=$HOME/root/apr-${APR_VERSION}"