Bug 818156 - Improve test chunking. r=gbrown
authorJoel Maher <jmaher@mozilla.com>
Thu, 06 Dec 2012 08:43:23 -0500
changeset 115200 dccbc4f3d092
parent 115199 115030ad174d
child 115201 f0112085d836
push id23991
push useremorley@mozilla.com
push date2012-12-07 14:14 +0000
treeherdermozilla-central@8432562db685 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgbrown
bugs818156
milestone20.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 818156 - Improve test chunking. r=gbrown
layout/tools/reftest/reftest.js
--- a/layout/tools/reftest/reftest.js
+++ b/layout/tools/reftest/reftest.js
@@ -445,16 +445,35 @@ function StartTests()
         gDumpLog("REFTEST TEST-UNEXPECTED-FAIL | | EXCEPTION: " + ex + "\n");
         DoneTests();
     }
 #endif
     try {
         ReadTopManifest(uri);
         BuildUseCounts();
 
+        // We need to filter the tests which will be skipped during this test run, so when we chunk,
+        // we have a more even distribution
+        var tURL = new Array();
+        for (var i = 0; i < gURLs.length; ++i) {
+            if (gURLs[i].expected == EXPECTED_DEATH)
+                continue;
+
+            if (gURLs[i].needsFocus && !Focus())
+                continue;
+
+            if (gURLs[i].slow && !gRunSlowTests)
+                continue;
+
+            tURL.push(gURLs[i]);
+        }
+
+        gDumpLog("REFTEST INFO | Discovered " + gURLs.length + " tests, after filtering SKIP tests, we have " + tURL.length + "\n");
+        gURLs = tURL;
+
         if (gTotalChunks > 0 && gThisChunk > 0) {
             var testsPerChunk = gURLs.length / gTotalChunks;
             var start = Math.round((gThisChunk-1) * testsPerChunk);
             var end = Math.round(gThisChunk * testsPerChunk);
             gURLs = gURLs.slice(start, end);
             gDumpLog("REFTEST INFO | Running chunk " + gThisChunk + " out of " + gTotalChunks + " chunks.  ")
             gDumpLog("tests " + (start+1) + "-" + end + "/" + gURLs.length + "\n");
         }