Bug 1243083 - Enable e10s by default when running mochitests, r?jmaher draft
authorAndrew Halberstadt <ahalberstadt@mozilla.com>
Fri, 01 Apr 2016 10:59:12 -0400
changeset 346779 f9fec4f14c2950cc918dff29b09f8ec6eec020b8
parent 346552 538d248fa252a4100082fd9bc3fdc08d322cda22
child 346780 970bbdf67d22255561c5cebcf4c12f20efa3d019
push id14440
push userahalberstadt@mozilla.com
push dateFri, 01 Apr 2016 15:37:30 +0000
reviewersjmaher
bugs1243083
milestone48.0a1
Bug 1243083 - Enable e10s by default when running mochitests, r?jmaher MozReview-Commit-ID: NlTGwdQ2nw
browser/extensions/loop/run-all-loop-tests.sh
testing/mochitest/mochitest_options.py
testing/mochitest/runtests.py
testing/mozharness/scripts/desktop_unittest.py
toolkit/components/formautofill/test/loader_common.js
--- a/browser/extensions/loop/run-all-loop-tests.sh
+++ b/browser/extensions/loop/run-all-loop-tests.sh
@@ -32,17 +32,17 @@ TESTS="
   browser/base/content/test/general/browser_devices_get_user_media_about_urls.js
   browser/base/content/test/general/browser_parsable_css.js
 "
 
 # Due to bug 1209463, we need to split these up and run them individually to
 # ensure we stop and report that there's an error.
 for test in $TESTS
 do
-  ./mach mochitest $test
+  ./mach mochitest --disable-e10s $test
   # UITour & get user media aren't compatible with e10s currenly.
   if [ "$1" != "--skip-e10s" ] && \
      [ "$test" != "browser/components/uitour/test/browser_UITour_loop.js" ] && \
      [ "$test" != "browser/base/content/test/general/browser_devices_get_user_media_about_urls.js" ];
   then
-    ./mach mochitest --e10s $test
+    ./mach mochitest $test
   fi
 done
--- a/testing/mochitest/mochitest_options.py
+++ b/testing/mochitest/mochitest_options.py
@@ -383,27 +383,21 @@ class MochitestArguments(ArgumentContain
           }],
         [["--debug-on-failure"],
          {"action": "store_true",
           "default": False,
           "dest": "debugOnFailure",
           "help": "Breaks execution and enters the JS debugger on a test failure. Should "
                   "be used together with --jsdebugger."
           }],
-        [["--e10s"],
-         {"action": "store_true",
-          "default": False,
-          "help": "Run tests with electrolysis preferences and test filtering enabled.",
-          }],
         [["--disable-e10s"],
          {"action": "store_false",
-          "default": False,
+          "default": True,
           "dest": "e10s",
           "help": "Run tests with electrolysis preferences and test filtering disabled.",
-          "suppress": True,
           }],
         [["--store-chrome-manifest"],
          {"action": "store",
           "help": "Destination path to write a copy of any chrome manifest "
                   "written by the harness.",
           "default": None,
           "suppress": True,
           }],
@@ -788,18 +782,22 @@ class MochitestArguments(ArgumentContain
                     '--use-test-media-devices is only supported on Linux currently')
             for f in ['/usr/bin/gst-launch-0.10', '/usr/bin/pactl']:
                 if not os.path.isfile(f):
                     parser.error(
                         'Missing binary %s required for '
                         '--use-test-media-devices' % f)
 
         if options.nested_oop:
-            if not options.e10s:
-                options.e10s = True
+            options.e10s = True
+
+        # a11y and chrome tests don't run with e10s enabled in CI
+        if options.a11y or options.chrome:
+            options.e10s = False
+
         mozinfo.update({"e10s": options.e10s})  # for test manifest parsing.
 
         options.leakThresholds = {
             "default": options.defaultLeakThreshold,
             "tab": 10000,  # See dependencies of bug 1051230.
             # GMP rarely gets a log, but when it does, it leaks a little.
             "geckomediaplugin": 20000,
         }
@@ -1170,16 +1168,21 @@ class AndroidArguments(ArgumentContainer
 
         if options.robocopApk != "":
             if not os.path.exists(options.robocopApk):
                 parser.error(
                     "Unable to find robocop APK '%s'" %
                     options.robocopApk)
             options.robocopApk = os.path.abspath(options.robocopApk)
 
+        # Disable e10s by default on Android because we don't run Android
+        # e10s jobs anywhere yet.
+        options.e10s = False
+        mozinfo.update({'e10s': options.e10s})
+
         # allow us to keep original application around for cleanup while
         # running robocop via 'am'
         options.remoteappname = options.app
         return options
 
 
 container_map = {
     'generic': [MochitestArguments],
--- a/testing/mochitest/runtests.py
+++ b/testing/mochitest/runtests.py
@@ -2331,16 +2331,17 @@ class MochitestDesktop(MochitestBase):
                 'port_timeout': options.marionette_port_timeout,
             }
 
             if options.marionette:
                 host, port = options.marionette.split(':')
                 marionette_args['host'] = host
                 marionette_args['port'] = int(port)
 
+            self.log.info("runtests.py | Running with e10s: {}".format(options.e10s))
             self.log.info("runtests.py | Running tests: start.\n")
             try:
                 status = self.runApp(testURL,
                                      self.browserEnv,
                                      options.app,
                                      profile=self.profile,
                                      extraArgs=options.browserArgs,
                                      utilityPath=options.utilityPath,
--- a/testing/mozharness/scripts/desktop_unittest.py
+++ b/testing/mozharness/scripts/desktop_unittest.py
@@ -28,16 +28,17 @@ from mozharness.mozilla.blob_upload impo
 from mozharness.mozilla.mozbase import MozbaseMixin
 from mozharness.mozilla.testing.codecoverage import (
     CodeCoverageMixin,
     code_coverage_config_options
 )
 from mozharness.mozilla.testing.testbase import TestingMixin, testing_config_options
 
 SUITE_CATEGORIES = ['gtest', 'cppunittest', 'jittest', 'mochitest', 'reftest', 'xpcshell', 'mozbase', 'mozmill']
+SUITE_DEFAULT_E10S = ['mochitest']
 
 # DesktopUnittest {{{1
 class DesktopUnittest(TestingMixin, MercurialScript, BlobUploadMixin, MozbaseMixin, CodeCoverageMixin):
     config_options = [
         [['--mochitest-suite', ], {
             "action": "extend",
             "dest": "specified_mochitest_suites",
             "type": "string",
@@ -314,17 +315,19 @@ class DesktopUnittest(TestingMixin, Merc
                                           'gtest'),
             }
 
             # TestingMixin._download_and_extract_symbols() will set
             # self.symbols_path when downloading/extracting.
             if self.symbols_path:
                 str_format_values['symbols_path'] = self.symbols_path
 
-            if c['e10s']:
+            if suite_category in SUITE_DEFAULT_E10S and not c['e10s']:
+                base_cmd.append('--disable-e10s')
+            elif suite_category not in SUITE_DEFAULT_E10S and c['e10s']:
                 base_cmd.append('--e10s')
 
             if c.get('strict_content_sandbox'):
                 if suite_category == "mochitest":
                     base_cmd.append('--strict-content-sandbox')
                 else:
                     self.fatal("--strict-content-sandbox only works with mochitest suites.")
 
--- a/toolkit/components/formautofill/test/loader_common.js
+++ b/toolkit/components/formautofill/test/loader_common.js
@@ -36,29 +36,29 @@
  * processes at first.  Normally, at this point only the registration of test
  * cases happen.  When everything has finished loading, tests are started and
  * appropriately synchronized between processes.
  *
  * Tests can be declared using the add_task syntax:
  *
  * add_task(function* test_something () { ... });
  *   This adds a test either in the parent process or child process:
- *     - Parent: xpcshell, mochitest-chrome without --e10s, mochitest-browser
- *     - Child: mochitest-chrome with --e10s
- *   In the future, these might run in the child process for "xpcshell --e10s".
+ *     - Parent: xpcshell, mochitest-chrome --disable-e10s, mochitest-browser
+ *     - Child: mochitest-chrome with e10s
+ *   In the future, these might run in the child process for "xpcshell".
  *
  * add_task_in_parent_process(function* test_something () { ... });
  *   This test runs in the parent process, but the child process will wait for
  *   its completion before continuing with the next task.  This wait currently
- *   happens only in mochitest-chrome with --e10s, in other frameworks that run
+ *   happens only in mochitest-chrome with e10s, in other frameworks that run
  *   only in the parent process this is the same as a normal add_task.
  *
  * add_task_in_child_process(function* test_something () { ... });
  *   This test runs only in the child process.  This means that the test is not
- *   run unless this is an e10s test, currently mochitest-chrome with --e10s.
+ *   run unless this is an e10s test, currently mochitest-chrome with e10s.
  *
  * add_task_in_both_processes(function* test_something () { ... });
  *   Useful for initialization that must be done both in the parent and the
  *   child, like setting preferences.
  *
  * add_termination_task(function* () { ... });
  *   Registers a new asynchronous termination task.  This is executed after all
  *   test cases in the file finished, and always in the same process where the