From 548d1181f84c009bc9db9cf046af07ccb6338499 Mon Sep 17 00:00:00 2001 From: Marian Raiciof Date: Tue, 12 Nov 2019 14:07:17 +0000 Subject: [PATCH] Bug 1567122 - Enable Fission for AWSY r=perftest-reviewers,stephendonner,sparky Differential Revision: https://phabricator.services.mozilla.com/D48660 --HG-- extra : moz-landing-system : lando --- taskcluster/ci/config.yml | 1 + taskcluster/ci/test/awsy.yml | 2 ++ testing/awsy/awsy/test_memory_usage.py | 4 ++++ testing/awsy/mach_commands.py | 5 ++++- .../marionette_harness/marionette_test/testcases.py | 13 +++++++++++++ testing/mozharness/scripts/awsy_script.py | 8 +++++++- 6 files changed, 31 insertions(+), 2 deletions(-) diff --git a/taskcluster/ci/config.yml b/taskcluster/ci/config.yml index 040c5ddff211..f33740c501fd 100755 --- a/taskcluster/ci/config.yml +++ b/taskcluster/ci/config.yml @@ -74,6 +74,7 @@ treeherder: 'tt': 'Telemetry tests' 'tt-1proc': 'Telemetry tests without e10s' 'SY': 'Are we slim yet tests by TaskCluster' + 'SY-fis': 'Are we slim yet tests by TaskCluster, fission enabled' 'SYsd': 'Are we slim yet tests by TaskCluster, Stylo disabled' 'SYss': 'Are we slim yet tests by TaskCluster, Stylo sequential' 'VP': 'VideoPuppeteer tests' diff --git a/taskcluster/ci/test/awsy.yml b/taskcluster/ci/test/awsy.yml index 257176dec22f..3339d45467b3 100644 --- a/taskcluster/ci/test/awsy.yml +++ b/taskcluster/ci/test/awsy.yml @@ -38,6 +38,7 @@ awsy: awsy-tp6: description: "Are we slim yet - tp6 pageset" + variants: ["fission"] treeherder-symbol: SY(sy-tp6) run-on-projects: by-test-platform: @@ -48,6 +49,7 @@ awsy-tp6: mozharness: extra-options: - --tp6 + - --enable-fission awsy-dmd: description: "Are we slim yet - dmd enabled" diff --git a/testing/awsy/awsy/test_memory_usage.py b/testing/awsy/awsy/test_memory_usage.py index 6e6ba63d07c5..3497512021fd 100644 --- a/testing/awsy/awsy/test_memory_usage.py +++ b/testing/awsy/awsy/test_memory_usage.py @@ -87,7 +87,11 @@ class TestMemoryUsage(AwsyTestCase): self._urls = urls # Indicate that we're using tp6 in the perf data. + # ENABLE_FISSION is accessed through inheritance: + # MarionetteTestCase :: AwsyTestCase :: TestMemoryUsage self._extra_opts = ["tp6"] + if TestMemoryUsage.ENABLE_FISSION: + self._extra_opts.append("fission-enabled") # Now we setup the mitm proxy with our tp6 pageset. tp6_pageset_manifest = os.path.join(AWSY_PATH, 'tp6-pageset.manifest') diff --git a/testing/awsy/mach_commands.py b/testing/awsy/mach_commands.py index 1452755c4f88..d4eae9616f33 100644 --- a/testing/awsy/mach_commands.py +++ b/testing/awsy/mach_commands.py @@ -75,7 +75,7 @@ class MachCommands(MachCommandBase): runtime_testvars = {} for arg in ('webRootDir', 'pageManifest', 'resultsDir', 'entities', 'iterations', - 'perTabPause', 'settleWaitTime', 'maxTabs', 'dmd', 'tp6'): + 'perTabPause', 'settleWaitTime', 'maxTabs', 'dmd', 'tp6', 'enable_fission'): if arg in kwargs and kwargs[arg] is not None: runtime_testvars[arg] = kwargs[arg] @@ -238,6 +238,9 @@ class MachCommands(MachCommandBase): @CommandArgument('--tp6', group='AWSY', action='store_true', dest='tp6', default=False, help='Use the tp6 pageset during testing.') + @CommandArgument('--enable-fission', group='AWSY', action='store_true', + dest='enable_fission', default=False, + help='Enable Fission (site isolation) in Gecko.') def run_awsy_test(self, tests, **kwargs): """mach awsy-test runs the in-tree version of the Are We Slim Yet (AWSY) tests. diff --git a/testing/marionette/harness/marionette_harness/marionette_test/testcases.py b/testing/marionette/harness/marionette_harness/marionette_test/testcases.py index e96e3a05a5c7..9e1950af2cef 100644 --- a/testing/marionette/harness/marionette_harness/marionette_test/testcases.py +++ b/testing/marionette/harness/marionette_harness/marionette_test/testcases.py @@ -286,6 +286,7 @@ class CommonTestCase(unittest.TestCase): class MarionetteTestCase(CommonTestCase): match_re = re.compile(r"test_(.*)\.py$") + ENABLE_FISSION = False def __init__(self, marionette_weakref, fixtures, methodName='runTest', filepath='', **kwargs): @@ -295,6 +296,18 @@ class MarionetteTestCase(CommonTestCase): super(MarionetteTestCase, self).__init__( methodName, marionette_weakref=marionette_weakref, fixtures=fixtures, **kwargs) + fission_in_flags = kwargs.get('enable_fission', False) + fission_in_prefs_args = False + if (kwargs.get('prefs_args') is not None) and \ + ('fission.autostart=true' in kwargs.get('prefs_args') or + '"fission.autostart=true"' in kwargs.get('prefs_args')): + fission_in_prefs_args = True + + # For 'mach awsy-test --tp6' fission is enabled through: + # "--enable-fission" flag on local runs + # or "prefs_args" on treeherder + MarionetteTestCase.ENABLE_FISSION = fission_in_flags or fission_in_prefs_args + @classmethod def add_tests_to_suite(cls, mod_name, filepath, suite, testloader, marionette, fixtures, testvars, **kwargs): diff --git a/testing/mozharness/scripts/awsy_script.py b/testing/mozharness/scripts/awsy_script.py index 9973f348d748..681217d757e4 100644 --- a/testing/mozharness/scripts/awsy_script.py +++ b/testing/mozharness/scripts/awsy_script.py @@ -79,7 +79,13 @@ class AWSY(TestingMixin, MercurialScript, TooltoolMixin, CodeCoverageMixin): "dest": "tp6", "default": False, "help": "Runs tests with the tp6 pageset.", - }] + }], + [["--enable-fission"], + {"action": "store_true", + "dest": "enable_fission", + "default": False, + "help": "Enable Fission (site isolation) in Gecko.", + }], ] + testing_config_options + copy.deepcopy(code_coverage_config_options)