Bug 1173114 - Fallback to chunk-by-dir if runtimes file not found. r=ahal, a=test-only
authorJonathan Griffin <jgriffin@mozilla.com>
Wed, 10 Jun 2015 10:12:31 -0700
changeset 275094 21380dd344849ebf69e03d3a519bf5222ac58fe4
parent 275093 265e9d1cff065b0a1ec43c387ea7a4d6bf773195
child 275095 ac2388c1775aa51a5bfd2f911f76a3785227327c
push id863
push userraliiev@mozilla.com
push dateMon, 03 Aug 2015 13:22:43 +0000
treeherdermozilla-release@f6321b14228d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersahal, test-only
bugs1173114
milestone40.0a2
Bug 1173114 - Fallback to chunk-by-dir if runtimes file not found. r=ahal, a=test-only CLOSED TREE
testing/mochitest/runtests.py
--- a/testing/mochitest/runtests.py
+++ b/testing/mochitest/runtests.py
@@ -1930,22 +1930,34 @@ class Mochitest(MochitestUtilsMixin):
 
                 filters = [
                     remove_imptest_failure_expectations,
                     subsuite(options.subsuite),
                 ]
 
                 # Add chunking filters if specified
                 if options.totalChunks:
+                    if options.chunkByRuntime:
+                        runtime_file = self.resolve_runtime_file(options, info)
+                        if not os.path.exists(runtime_file):
+                            self.log.warning("runtime file %s not found; defaulting to chunk-by-dir" %
+                                             runtime_file)
+                            options.chunkByRuntime = None
+                            flavor = self.getTestFlavor(options)
+                            if flavor in ('browser-chrome', 'devtools-chrome'):
+                                # these values match current mozharness configs
+                                options.chunkbyDir = 5
+                            else:
+                                options.chunkByDir = 4
+
                     if options.chunkByDir:
                         filters.append(chunk_by_dir(options.thisChunk,
                                                     options.totalChunks,
                                                     options.chunkByDir))
                     elif options.chunkByRuntime:
-                        runtime_file = self.resolve_runtime_file(options, info)
                         with open(runtime_file, 'r') as f:
                             runtime_data = json.loads(f.read())
                         runtimes = runtime_data['runtimes']
                         default = runtime_data['excluded_test_average']
                         filters.append(
                             chunk_by_runtime(options.thisChunk,
                                              options.totalChunks,
                                              runtimes,