Patchwork D10937: testing: fix _timeout_factor

login
register
mail settings
Submitter phabricator
Date July 2, 2021, 10:36 p.m.
Message ID <differential-rev-PHID-DREV-ewxhnvglvwlyav2pfcvy-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/49251/
State Superseded
Headers show

Comments

phabricator - July 2, 2021, 10:36 p.m.
marmoute created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  With `--debug`, `run-tests.py` set the timeout to 0... that breaks the logic in
  `mercurial.testing`.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/testing/__init__.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/testing/__init__.py b/mercurial/testing/__init__.py
--- a/mercurial/testing/__init__.py
+++ b/mercurial/testing/__init__.py
@@ -16,8 +16,10 @@ 
 
 def _timeout_factor():
     """return the current modification to timeout"""
-    default = int(environ.get('HGTEST_TIMEOUT_DEFAULT', 1))
+    default = int(environ.get('HGTEST_TIMEOUT_DEFAULT', 360))
     current = int(environ.get('HGTEST_TIMEOUT', default))
+    if current == 0:
+        return 1
     return current / float(default)