[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#867361: sitesummary: Fix autopkgtest to work in environments with http_proxy set



On Fri, Jul 07, 2017 at 01:19:17PM +0200, Petter Reinholdtsen wrote:
> What about a loop looking for a file every 1 second, and exiting after X
> seconds if no file is found.  It should handle more load while exiting
> as quickly as possible.
 
I guess something like this should work:

--- a/test-server-client	2017-07-07 11:16:36.000000000 +0200
+++ b/test-server-client	2017-07-07 15:21:45.881225852 +0200
@@ -29,9 +29,13 @@
 
 find /var/lib/sitesummary
 
-if find /var/lib/sitesummary | grep ether- ; then
-    echo success: found entry
-else
-    echo error: did not find entry
-    exit 1
-fi
+for i in $(seq 0 10) ; do
+    if find /var/lib/sitesummary | grep ether- ; then
+	echo success: found entry
+	exit 0
+    fi
+    sleep 1
+done
+
+echo error: did not find entry after waiting for 10 seconds.
+exit 1

Wolfgang

Attachment: signature.asc
Description: PGP signature


Reply to: