diff tests/run-tests.py @ 44632:82543879b48e

testlib: adjust wait-on-file timeout according to the global test timeout Lets assume that if test timeout have been set to be twice as long, it means local timeout should be twice as long too. I am not aware of any case were extending timeout for file based synchronisation was necessary, but the safety seems simple to implements. Differential Revision: https://phab.mercurial-scm.org/D8316
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Fri, 20 Mar 2020 23:41:35 +0100
parents 78a8f65eacc8
children 617cd3b1e9cd bd0f122f3f51
line wrap: on
line diff
--- a/tests/run-tests.py	Fri Feb 28 02:23:28 2020 +0100
+++ b/tests/run-tests.py	Fri Mar 20 23:41:35 2020 +0100
@@ -321,7 +321,7 @@
 if 'java' in sys.platform:
     IMPL_PATH = b'JYTHONPATH'
 
-defaults = {
+default_defaults = {
     'jobs': ('HGTEST_JOBS', multiprocessing.cpu_count()),
     'timeout': ('HGTEST_TIMEOUT', 180),
     'slowtimeout': ('HGTEST_SLOWTIMEOUT', 1500),
@@ -329,6 +329,8 @@
     'shell': ('HGTEST_SHELL', 'sh'),
 }
 
+defaults = default_defaults.copy()
+
 
 def canonpath(path):
     return os.path.realpath(os.path.expanduser(path))
@@ -1327,6 +1329,9 @@
         env['TESTTMP'] = _bytes2sys(self._testtmp)
         env['TESTNAME'] = self.name
         env['HOME'] = _bytes2sys(self._testtmp)
+        formated_timeout = _bytes2sys(b"%d" % default_defaults['timeout'][1])
+        env['HGTEST_TIMEOUT_DEFAULT'] = formated_timeout
+        env['HGTEST_TIMEOUT'] = _bytes2sys(b"%d" % self._timeout)
         # This number should match portneeded in _getport
         for port in xrange(3):
             # This list should be parallel to _portmap in _getreplacements