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
--- 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)