summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2015-07-19 18:52:30 +0100
committerIan Jackson <ijackson@chiark.greenend.org.uk>2015-07-19 18:58:37 +0100
commitb41c0ab7f4a34da89964ce85ffeccae6dce52191 (patch)
treeb5a828de4d010f0e18aba64369f43bdc3b18f19f
parent6a8f914beb77ec4cc36ed0aecb0e5da31a450418 (diff)
Test suite: mirror: Synchronise properly with drs background mirror
-rwxr-xr-xtests/tests/mirror16
1 files changed, 11 insertions, 5 deletions
diff --git a/tests/tests/mirror b/tests/tests/mirror
index 6f6300e..0889b18 100755
--- a/tests/tests/mirror
+++ b/tests/tests/mirror
@@ -30,8 +30,6 @@ set -ex
cat >&2 $sentinel
shift # eat HOST
sh -c "\$*"
-: ${sentinel}2
-date >${sentinel}2
END
chmod +x $tmp/stunt-ssh
@@ -53,8 +51,8 @@ t-check-mirrored
: ----- "stall timeout test" -----
-rm -f $sentinel ${sentinel}2
-mkfifo $sentinel ${sentinel}2
+rm -f $sentinel
+mkfifo $sentinel
t-mirror-set hooktimeout=5
@@ -65,7 +63,15 @@ t-check-not-mirrored
exec 3<>$sentinel
exec 3>&-
-cat ${sentinel}2
+
+attempts=100
+while [ -f $queuedir/$p.lock ]; do
+ if [ $attempts = 0 ]; then \
+ fail "timed out waiting for lock to go away"
+ fi
+ attempts=$(( $attempts - 1 ))
+ sleep 0.1
+done
t-check-mirrored