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 521702 8130ba1701bb
parent 521701 fcdfe2be33a5
child 521703 956e0ebc41ad
push id10867
push userdvarga@mozilla.com
push dateThu, 14 Mar 2019 15:20:45 +0000
treeherdermozilla-beta@abad13547875 [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()