changeset 47493:2dac94edd98d

testing: fix _timeout_factor With `--debug`, `run-tests.py` set the timeout to 0... that breaks the logic in `mercurial.testing`. Differential Revision: https://phab.mercurial-scm.org/D10937
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Fri, 02 Jul 2021 20:18:42 +0200
parents f03e9d30258e
children 81d70de39c7e
files mercurial/testing/__init__.py
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/testing/__init__.py	Sat Jul 03 10:21:16 2021 +0300
+++ b/mercurial/testing/__init__.py	Fri Jul 02 20:18:42 2021 +0200
@@ -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)