# HG changeset patch # User Matt Mackall # Date 2013-06-02 22:58:49 # Node ID 0a5e19007cd11c0545e5843920fa6f0ce35ff9d2 # Parent eea17b7e601a7f85eb9de2a85b787dd7f7e43054 run-tests: sort certain slow tests earlier by keyword There are a few tests that evade the size heuristic diff --git a/tests/run-tests.py b/tests/run-tests.py --- a/tests/run-tests.py +++ b/tests/run-tests.py @@ -1162,8 +1162,16 @@ def main(): if options.random: random.shuffle(tests) else: - # run largest tests first, as they tend to take the longest - tests.sort(key=lambda x: -os.stat(x).st_size) + # keywords for slow tests + slow = 'svn gendoc check-code-hg'.split() + def sortkey(f): + # run largest tests first, as they tend to take the longest + val = -os.stat(f).st_size + for kw in slow: + if kw in f: + val *= 10 + return val + tests.sort(key=sortkey) if 'PYTHONHASHSEED' not in os.environ: # use a random python hash seed all the time