run-tests: sort certain slow tests earlier by keyword stable
authorMatt Mackall <mpm@selenic.com>
Sun, 02 Jun 2013 17:58:49 -0500
branchstable
changeset 1259 71fcece633e4
parent 1258 4cde0e29010b
child 1260 d9ebd2545572
run-tests: sort certain slow tests earlier by keyword There are a few tests that evade the size heuristic [ original upstream message ]
tests/run-tests.py
--- a/tests/run-tests.py	Sun Jun 02 17:57:37 2013 -0500
+++ b/tests/run-tests.py	Sun Jun 02 17:58:49 2013 -0500
@@ -1162,8 +1162,16 @@
     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