Bug 1526654 - Use xpcshell sequential mode consistently when running a single test; r=bc
authorGeoff Brown <gbrown@mozilla.com>
Wed, 13 Mar 2019 06:14:52 +0000
changeset 524700 8130ba1701bbd69ec304eca887c0e66e9e1307ef
parent 524699 fcdfe2be33a5fa5a531d18f3f4302aa48df5f3e0
child 524701 956e0ebc41ad4af3497084bcd03220a65923cf8f
push id2032
push userffxbld-merge
push dateMon, 13 May 2019 09:36:57 +0000
treeherdermozilla-release@455c1065dcbe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbc
bugs1526654
milestone67.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 1526654 - Use xpcshell sequential mode consistently when running a single test; r=bc In the harness, sequential mode is set when self.singleFile is set. self.singleFile has been set correctly when a single test is specified as a test_path (mach xpcshell-test <test>) but it has not been set correctly if a single test is specified in a manifest (mach test <test); this patch corrects for that by setting self.singleFile after all test specifications have set self.alltests. An unintended consequence of the code rearrangement is that the chunk_by_slice filter is now used even when self.singleFile would be set -- but only if totalChunks > 1; this situation seems very unlikely, and the consequences minimal. Differential Revision: https://phabricator.services.mozilla.com/D23253
testing/xpcshell/runxpcshelltests.py
--- a/testing/xpcshell/runxpcshelltests.py
+++ b/testing/xpcshell/runxpcshelltests.py
@@ -877,49 +877,49 @@ class XPCShellTests(object):
             test_paths (list, optional): list of strings derived from the command
                                          line argument provided by user, specifying
                                          tests to be run.
             verify (bool, optional): boolean value.
         """
         if test_paths is None:
             test_paths = []
 
-        if len(test_paths) == 1 and test_paths[0].endswith(".js") and not verify:
-            self.singleFile = os.path.basename(test_paths[0])
-        else:
-            self.singleFile = None
-
         mp = self.getTestManifest(self.manifest)
 
         root = mp.rootdir
         if build and not root:
             root = build.topsrcdir
         normalize = partial(self.normalizeTest, root)
 
         filters = []
         if test_tags:
             filters.append(tags(test_tags))
 
         if test_paths:
             filters.append(pathprefix(test_paths))
 
-        if self.singleFile is None and self.totalChunks > 1:
+        if self.totalChunks > 1:
             filters.append(chunk_by_slice(self.thisChunk, self.totalChunks))
         try:
             self.alltests = map(normalize, mp.active_tests(filters=filters, **mozinfo.info))
         except TypeError:
             sys.stderr.write("*** offending mozinfo.info: %s\n" % repr(mozinfo.info))
             raise
 
         if len(self.alltests) == 0:
             self.log.error("no tests to run using specified "
                            "combination of filters: {}".format(
                                 mp.fmt_filters()))
             sys.exit(1)
 
+        if len(self.alltests) == 1 and not verify:
+            self.singleFile = os.path.basename(self.alltests[0]['path'])
+        else:
+            self.singleFile = None
+
         if self.dump_tests:
             self.dump_tests = os.path.expanduser(self.dump_tests)
             assert os.path.exists(os.path.dirname(self.dump_tests))
             with open(self.dump_tests, 'w') as dumpFile:
                 dumpFile.write(json.dumps({'active_tests': self.alltests}))
 
             self.log.info("Dumping active_tests to %s file." % self.dump_tests)
             sys.exit()