# HG changeset patch # User Pierre-Yves David # Date 2019-02-24 18:56:34 # Node ID 7eb4e62d476022ff7e40cbb51eb4caaecbf2250c # Parent 9f53a4e2e193974b562acab943c43f7bce83e6f5 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. diff --git a/tests/run-tests.py b/tests/run-tests.py --- a/tests/run-tests.py +++ b/tests/run-tests.py @@ -1374,12 +1374,16 @@ class TTest(Test): 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 = []