changeset 41807:7eb4e62d4760

runtest: extract the logic that update timeout for slow tests We want to use the "slow" test logic not only for "#require" clauses but also in "#if" clauses. For this to be useful we need the logic to bump the timeout in at least two spots. The first step it to factor it out.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Sun, 24 Feb 2019 19:56:34 +0100
parents 9f53a4e2e193
children bc1c1435a874
files tests/run-tests.py
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/tests/run-tests.py	Sun Feb 24 19:56:40 2019 +0100
+++ b/tests/run-tests.py	Sun Feb 24 19:56:34 2019 +0100
@@ -1374,12 +1374,16 @@
             self._have[allreqs] = (False, stdout)
             return False, stdout
 
-        if b'slow' in reqs:
-            self._timeout = self._slowtimeout
+        self._detectslow(reqs)
 
         self._have[allreqs] = (True, None)
         return True, None
 
+    def _detectslow(self, reqs):
+        """update the timeout of slow test when appropriate"""
+        if b'slow' in reqs:
+            self._timeout = self._slowtimeout
+
     def _iftest(self, args):
         # implements "#if"
         reqs = []