Patchwork D12382: test: use `wait-on-file` in `test-racy-mutations.t`

login
register
mail settings
Submitter phabricator
Date March 17, 2022, 2:16 p.m.
Message ID <differential-rev-PHID-DREV-un5xfitjbhqgmnbg6kgj-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/50726/
State New
Headers show

Comments

phabricator - March 17, 2022, 2:16 p.m.
marmoute created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  The official utility scale its timeout with the run-tests.py one. So lets use
  it.

REPOSITORY
  rHG Mercurial

BRANCH
  stable

REVISION DETAIL
  https://phab.mercurial-scm.org/D12382

AFFECTED FILES
  tests/test-racy-mutations.t

CHANGE DETAILS




To: marmoute, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/tests/test-racy-mutations.t b/tests/test-racy-mutations.t
--- a/tests/test-racy-mutations.t
+++ b/tests/test-racy-mutations.t
@@ -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