test: use `wait-on-file` in `test-racy-mutations.t` stable
authorPierre-Yves David <pierre-yves.david@octobus.net>
Thu, 17 Mar 2022 14:58:46 +0100
branchstable
changeset 48977 bd752712ccaf
parent 48976 877d7e1a4223
child 48978 c80544aa4971
child 48979 9120c0cd935c
test: use `wait-on-file` in `test-racy-mutations.t` The official utility scale its timeout with the run-tests.py one. So lets use it. Differential Revision: https://phab.mercurial-scm.org/D12382
tests/test-racy-mutations.t
--- a/tests/test-racy-mutations.t	Fri Mar 18 21:15:54 2022 -0700
+++ b/tests/test-racy-mutations.t	Thu Mar 17 14:58:46 2022 +0100
@@ -14,14 +14,7 @@
   >     f="\${WAITLOCK_FILE}"
   >     start=\`date +%s\`
   >     timeout=5
-  >     while [ \\( ! -f \$f \\) -a \\( ! -L \$f \\) ]; do
-  >         now=\`date +%s\`
-  >         if [ "\`expr \$now - \$start\`" -gt \$timeout ]; then
-  >             echo "timeout: \$f was not created in \$timeout seconds (it is now \$(date +%s))"
-  >             exit 1
-  >         fi
-  >         sleep 0.1
-  >     done
+  >     $RUNTESTDIR/testlib/wait-on-file "\$timeout" "\$f"
   >     if [ \$# -gt 1 ]; then
   >         cat "\$@"
   >     fi