Bug 1380053 - Default to parallel Stylo traversal in tests. r=catlee
authorJ. Ryan Stinnett <jryans@gmail.com>
Tue, 25 Jul 2017 16:06:38 -0500
changeset 420205 8f1268aef844ddf1fecca6512a57c04c8c40ae51
parent 420204 951aac3f7728936077ced35aec833aee11254bdd
child 420206 30fb5403e45cdae7577bbfef400b384f944af66d
push id7566
push usermtabara@mozilla.com
push dateWed, 02 Aug 2017 08:25:16 +0000
treeherdermozilla-beta@86913f512c3c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscatlee
bugs1380053, 1356122
milestone56.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 1380053 - Default to parallel Stylo traversal in tests. r=catlee Flip around the logic of bug 1356122, so that the default from Stylo runs is the parallel traversal, but we can opt in to single traversal as desired. This ensures that for testing on other desktop platforms, we use parallel traversal as the default. MozReview-Commit-ID: KoBe1ltHP52
taskcluster/taskgraph/transforms/tests.py
testing/mozharness/scripts/desktop_unittest.py
testing/mozharness/scripts/web_platform_tests.py
--- a/taskcluster/taskgraph/transforms/tests.py
+++ b/taskcluster/taskgraph/transforms/tests.py
@@ -760,42 +760,28 @@ def enable_stylo(config, tests):
 
         if 'reftest-stylo' not in test['suite']:
             test['mozharness'].setdefault('extra-options', []).append('--enable-stylo')
 
         yield test
 
 
 @transforms.add
-def parallel_stylo_tests(config, tests):
-    """Ensure that any stylo tests running with e10s enabled also test
-    parallel traversal in the style system."""
+def single_stylo_traversal_tests(config, tests):
+    """Enable single traversal for all tests on the sequential Stylo platform."""
 
     for test in tests:
-        if (not test['test-platform'].startswith('linux64-stylo/')) and \
-           (not test['test-platform'].startswith('linux64-stylo-sequential/')):
-            yield test
-            continue
-
-        e10s = test['e10s']
-        # We should have already handled 'both' in an earlier transform.
-        assert e10s != 'both'
-        if not e10s:
+        if not test['test-platform'].startswith('linux64-stylo-sequential/'):
             yield test
             continue
 
         # Bug 1356122 - Run Stylo tests in sequential mode
-        if test['test-platform'].startswith('linux64-stylo-sequential/'):
-            yield test
-
-        if test['test-platform'].startswith('linux64-stylo/'):
-            # add parallel stylo tests
-            test['mozharness'].setdefault('extra-options', [])\
-                              .append('--parallel-stylo-traversal')
-            yield test
+        test['mozharness'].setdefault('extra-options', [])\
+                          .append('--single-stylo-traversal')
+        yield test
 
 
 @transforms.add
 def set_worker_type(config, tests):
     """Set the worker type based on the test platform."""
     for test in tests:
         # during the taskcluster migration, this is a bit tortured, but it
         # will get simpler eventually!
--- a/testing/mozharness/scripts/desktop_unittest.py
+++ b/testing/mozharness/scripts/desktop_unittest.py
@@ -139,21 +139,21 @@ class DesktopUnittest(TestingMixin, Merc
             "help": "Number of this chunk"}
          ],
         [["--allow-software-gl-layers"], {
             "action": "store_true",
             "dest": "allow_software_gl_layers",
             "default": False,
             "help": "Permits a software GL implementation (such as LLVMPipe) to use the GL compositor."}
          ],
-        [["--parallel-stylo-traversal"], {
+        [["--single-stylo-traversal"], {
             "action": "store_true",
-            "dest": "parallel_stylo_traversal",
+            "dest": "single_stylo_traversal",
             "default": False,
-            "help": "Forcibly enable parallel traversal in Stylo with STYLO_THREADS=4"}
+            "help": "Forcibly enable single thread traversal in Stylo with STYLO_THREADS=1"}
          ],
         [["--enable-stylo"], {
             "action": "store_true",
             "dest": "enable_stylo",
             "default": False,
             "help": "Run tests with Stylo enabled"}
          ],
         [["--enable-webrender"], {
@@ -713,17 +713,20 @@ class DesktopUnittest(TestingMixin, Merc
                 if not os.path.isdir(env['MOZ_UPLOAD_DIR']):
                     self.mkdir_p(env['MOZ_UPLOAD_DIR'])
 
                 if self.config['allow_software_gl_layers']:
                     env['MOZ_LAYERS_ALLOW_SOFTWARE_GL'] = '1'
                 if self.config['enable_webrender']:
                     env['MOZ_WEBRENDER'] = '1'
 
-                env['STYLO_THREADS'] = '4' if self.config['parallel_stylo_traversal'] else '1'
+                if self.config['single_stylo_traversal']:
+                    env['STYLO_THREADS'] = '1'
+                else:
+                    env['STYLO_THREADS'] = '4'
                 if self.config['enable_stylo']:
                     env['STYLO_FORCE_ENABLED'] = '1'
 
                 env = self.query_env(partial_env=env, log_level=INFO)
                 cmd_timeout = self.get_timeout_for_category(suite_category)
                 return_code = self.run_command(cmd, cwd=dirs['abs_work_dir'],
                                                output_timeout=cmd_timeout,
                                                output_parser=parser,
--- a/testing/mozharness/scripts/web_platform_tests.py
+++ b/testing/mozharness/scripts/web_platform_tests.py
@@ -57,21 +57,21 @@ class WebPlatformTest(TestingMixin, Merc
             "help": "Permits a software GL implementation (such as LLVMPipe) to use the GL compositor."}
          ],
         [["--enable-webrender"], {
             "action": "store_true",
             "dest": "enable_webrender",
             "default": False,
             "help": "Tries to enable the WebRender compositor."}
          ],
-        [["--parallel-stylo-traversal"], {
+        [["--single-stylo-traversal"], {
             "action": "store_true",
-            "dest": "parallel_stylo_traversal",
+            "dest": "single_stylo_traversal",
             "default": False,
-            "help": "Forcibly enable parallel traversal in Stylo with STYLO_THREADS=4"}
+            "help": "Forcibly enable single thread traversal in Stylo with STYLO_THREADS=1"}
          ],
         [["--enable-stylo"], {
             "action": "store_true",
             "dest": "enable_stylo",
             "default": False,
             "help": "Run tests with Stylo enabled"}
          ],
     ] + copy.deepcopy(testing_config_options) + \
@@ -177,17 +177,19 @@ class WebPlatformTest(TestingMixin, Merc
         wpt_test_paths = self.try_test_paths.get("web-platform-tests")
         if not wpt_test_paths:
             for test_type in c.get("test_type", []):
                 cmd.append("--test-type=%s" % test_type)
 
         if not c["e10s"]:
             cmd.append("--disable-e10s")
 
-        if c["parallel_stylo_traversal"]:
+        if c["single_stylo_traversal"]:
+            cmd.append("--stylo-threads=1")
+        else:
             cmd.append("--stylo-threads=4")
 
         for opt in ["total_chunks", "this_chunk"]:
             val = c.get(opt)
             if val:
                 cmd.append("--%s=%s" % (opt.replace("_", "-"), val))
 
         if wpt_test_paths or "wdspec" in c.get("test_type", []):
@@ -257,17 +259,20 @@ class WebPlatformTest(TestingMixin, Merc
         env = {'MINIDUMP_SAVE_PATH': dirs['abs_blob_upload_dir']}
         env['RUST_BACKTRACE'] = '1'
 
         if self.config['allow_software_gl_layers']:
             env['MOZ_LAYERS_ALLOW_SOFTWARE_GL'] = '1'
         if self.config['enable_webrender']:
             env['MOZ_WEBRENDER'] = '1'
 
-        env['STYLO_THREADS'] = '4' if self.config['parallel_stylo_traversal'] else '1'
+        if self.config['single_stylo_traversal']:
+            env['STYLO_THREADS'] = '1'
+        else:
+            env['STYLO_THREADS'] = '4'
         if self.config['enable_stylo']:
             env['STYLO_FORCE_ENABLED'] = '1'
 
         env = self.query_env(partial_env=env, log_level=INFO)
 
         return_code = self.run_command(cmd,
                                        cwd=dirs['abs_work_dir'],
                                        output_timeout=1000,