# HG changeset patch # User Pierre-Yves David # Date 2021-07-02 18:18:42 # Node ID 2dac94edd98dc0da50466759c7fc2299ea037648 # Parent f03e9d30258e5b73f43b73ba770a7b9cdc6b5bdc 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 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 @@ environ = getattr(os, 'environ') 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)