[master] 3fb7df711 Change the back-off algorithm to be less aggresive when builds fail

Poul-Henning Kamp phk at FreeBSD.org
Wed Jul 29 22:25:13 UTC 2020


commit 3fb7df7112cdb2e1f1b2a9784d1f41372e9d2663
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Wed Jul 29 22:24:26 2020 +0000

    Change the back-off algorithm to be less aggresive when builds fail

diff --git a/tools/vtest.sh b/tools/vtest.sh
index de8cd8649..5ebb4e165 100755
--- a/tools/vtest.sh
+++ b/tools/vtest.sh
@@ -44,9 +44,9 @@ export TMPDIR="${TMPDIR:-`pwd`/_vtest_tmp}"
 MESSAGE="${MESSAGE:-}"
 
 WAITPERIOD=60		# unit: Seconds
+WAITMIN=1		# unit: WAITPERIOD
+WAITMAX=60		# unit: WAITPERIOD
 
-WAITGOOD=60		# unit: WAITPERIOD
-WAITBAD=1		# unit: WAITPERIOD
 MAXRUNS="${MAXRUNS:-0}"
 
 #######################################################################
@@ -209,7 +209,8 @@ if $enable_gcov ; then
 fi
 
 orev=000
-waitnext=${WAITBAD}
+waitnext=0
+waitcur=${WAITMIN}
 i=0
 
 while [ $MAXRUNS -eq 0 ] || [ $i -lt $MAXRUNS ]
@@ -219,13 +220,23 @@ do
 	(cd "${SRCDIR}" && git reset --hard > /dev/null 2>&1 || true)
 	(cd "${SRCDIR}" && git clean -df > /dev/null 2>&1 || true)
 	(cd "${SRCDIR}" && git pull > /dev/null 2>&1 || true)
+	(cd "${SRCDIR}" && chmod -R +w varnish-trunk && rm -rf varnish-trunk > /dev/null 2>&1 || true)
 	rev=`cd "${SRCDIR}" && git show -s --pretty=format:%H`
-	if [ "${waitnext}" -gt 0 -a "x${rev}" = "x${orev}" ] ; then
+	if [ "x${rev}" != "x${orev}" ] ; then
+                waitcur=${WAITMIN}
+	elif [ "${waitnext}" -gt 0 ] ; then
 		sleep ${WAITPERIOD}
 		waitnext=`expr ${waitnext} - 1 || true`
 		continue
+	else 
+		waitcur=`expr ${waitcur} + 1`
+		if [ ${waitcur} -gt ${WAITMAX} ] ; then
+			waitcur=${WAITMAX}
+		fi
 	fi
-	waitnext=${WAITBAD}
+
+	waitnext=${waitcur}
+
 	orev=${rev}
 
 	if ! [ -d "${SRCDIR}" ] && ! mkdir -p "${SRCDIR}" ; then
@@ -265,7 +276,8 @@ do
 				mv ${SRCDIR}/_gcov ${REPORTDIR}/
 				echo "MAKEGCOV GOOD" >> ${VTEST_REPORT}
 				echo "MANIFEST _gcov" >> ${VTEST_REPORT}
-				waitnext=${WAITGOOD}
+				waitcur=${WAITMAX}
+				waitnext=${WAITMAX}
 			else
 				echo "MAKEGCOV BAD" >> ${VTEST_REPORT}
 				echo "MANIFEST _makegcov" >> ${VTEST_REPORT}
@@ -278,7 +290,8 @@ do
 			failedtests >> ${VTEST_REPORT}
 		else
 			echo "MAKEDISTCHECK GOOD" >> ${VTEST_REPORT}
-			waitnext=${WAITGOOD}
+			waitnext=${WAITMAX}
+			waitcur=${WAITMAX}
 		fi
 	fi
 	echo "VTEST END" >> ${VTEST_REPORT}


More information about the varnish-commit mailing list