Patchwork D8453: wait-on-file: adjust the timer counter

login
register
mail settings
Submitter phabricator
Date April 16, 2020, 9 p.m.
Message ID <differential-rev-PHID-DREV-kq63aseq4iplx3hss26c-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/46177/
State Superseded
Headers show

Comments

phabricator - April 16, 2020, 9 p.m.
marmoute created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  The wait performed in increment of 0.01 second, but the timer was expressed in
  second. So we did not wait 20s, we waited 0.2 second. Internally we adjust the
  counter to be expressed in centisecond. This prevent some flackyness in the
  test.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  tests/testlib/wait-on-file

CHANGE DETAILS




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

Patch

diff --git a/tests/testlib/wait-on-file b/tests/testlib/wait-on-file
--- a/tests/testlib/wait-on-file
+++ b/tests/testlib/wait-on-file
@@ -13,7 +13,7 @@ 
 
 # if the test timeout have been extended, explicitly extend the provided timer
 if [ "$HGTEST_TIMEOUT_DEFAULT" -lt "$HGTEST_TIMEOUT" ]; then
-    timer=$(( ($timer * $HGTEST_TIMEOUT) / $HGTEST_TIMEOUT_DEFAULT ))
+    timer=$(( ( 100 * $timer * $HGTEST_TIMEOUT) / $HGTEST_TIMEOUT_DEFAULT ))
 fi
 
 wait_on="$2"