Bug 1119211 - Disable the 360 second socket timeout when marionette is invoked with --jsdebugger.;r=ato
authorChris Manchester <cmanchester@mozilla.com>
Thu, 19 Feb 2015 17:41:37 -0800
changeset 257087 521af16144ac1e5cc8fb4f7b03989b533e5d4506
parent 257086 a71a4b10000ab73c33eec3b0eacfe53da1325763
child 257088 07a480f4761e5ff9608e7bfc8c469605541561b9
push id4610
push userjlund@mozilla.com
push dateMon, 30 Mar 2015 18:32:55 +0000
treeherdermozilla-beta@4df54044d9ef [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersato
bugs1119211
milestone38.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 1119211 - Disable the 360 second socket timeout when marionette is invoked with --jsdebugger.;r=ato
testing/marionette/client/marionette/runner/base.py
--- a/testing/marionette/client/marionette/runner/base.py
+++ b/testing/marionette/client/marionette/runner/base.py
@@ -237,16 +237,18 @@ class MarionetteTextTestRunner(Structure
             pre_run_func()
 
         result = super(MarionetteTextTestRunner, self).run(test)
         result.printLogs(test)
         return result
 
 
 class BaseMarionetteOptions(OptionParser):
+    socket_timeout_default = 360.0
+
     def __init__(self, **kwargs):
         OptionParser.__init__(self, **kwargs)
         self.parse_args_handlers = [] # Used by mixins
         self.verify_usage_handlers = [] # Used by mixins
         self.add_option('--emulator',
                         action='store',
                         dest='emulator',
                         choices=['x86', 'arm'],
@@ -396,16 +398,21 @@ class BaseMarionetteOptions(OptionParser
                         action='store',
                         default='Marionette-based Tests',
                         help='Define the name to associate with the logger used')
         self.add_option('--jsdebugger',
                         dest='jsdebugger',
                         action='store_true',
                         default=False,
                         help='Enable the jsdebugger for marionette javascript.')
+        self.add_option('--socket-timeout',
+                        dest='socket_timeout',
+                        action='store',
+                        default=self.socket_timeout_default,
+                        help='Set the global timeout for marionette socket operations.')
         self.add_option('--e10s',
                         dest='e10s',
                         action='store_true',
                         default=False,
                         help='Enable e10s when running marionette tests.')
 
     def parse_args(self, args=None, values=None):
         options, tests = OptionParser.parse_args(self, args, values)
@@ -452,16 +459,17 @@ class BaseMarionetteOptions(OptionParser
         if options.total_chunks is not None:
             if not 1 <= options.total_chunks:
                 self.error('Total chunks must be greater than 1.')
             if not 1 <= options.this_chunk <= options.total_chunks:
                 self.error('Chunk to run must be between 1 and %s.' % options.total_chunks)
 
         if options.jsdebugger:
             options.app_args.append('-jsdebugger')
+            options.socket_timeout = None
 
         if options.e10s:
             options.prefs = {
                 'browser.tabs.remote.autostart': True
             }
 
         for handler in self.verify_usage_handlers:
             handler(options, tests)
@@ -477,17 +485,19 @@ class BaseMarionetteTestRunner(object):
                  emulator_img=None, emulator_res='480x800', homedir=None,
                  app=None, app_args=None, binary=None, profile=None,
                  logger=None, no_window=False, logdir=None, logcat_stdout=False,
                  xml_output=None, repeat=0, testvars=None, tree=None, type=None,
                  device_serial=None, symbols_path=None, timeout=None,
                  shuffle=False, shuffle_seed=random.randint(0, sys.maxint),
                  sdcard=None, this_chunk=1, total_chunks=1, sources=None,
                  server_root=None, gecko_log=None, result_callbacks=None,
-                 adb_host=None, adb_port=None, prefs=None, **kwargs):
+                 adb_host=None, adb_port=None, prefs=None,
+                 socket_timeout=BaseMarionetteOptions.socket_timeout_default,
+                 **kwargs):
         self.address = address
         self.emulator = emulator
         self.emulator_binary = emulator_binary
         self.emulator_img = emulator_img
         self.emulator_res = emulator_res
         self.homedir = homedir
         self.app = app
         self.app_args = app_args or []
@@ -502,16 +512,17 @@ class BaseMarionetteTestRunner(object):
         self.xml_output = xml_output
         self.repeat = repeat
         self.test_kwargs = kwargs
         self.tree = tree
         self.type = type
         self.device_serial = device_serial
         self.symbols_path = symbols_path
         self.timeout = timeout
+        self.socket_timeout = socket_timeout
         self._device = None
         self._capabilities = None
         self._appName = None
         self.shuffle = shuffle
         self.shuffle_seed = shuffle_seed
         self.sdcard = sdcard
         self.sources = sources
         self.server_root = server_root
@@ -633,16 +644,17 @@ class BaseMarionetteTestRunner(object):
             self.marionette.baseurl = self.server_root
             self.logger.info('using content from %s' % self.marionette.baseurl)
 
     def _build_kwargs(self):
         kwargs = {
             'device_serial': self.device_serial,
             'symbols_path': self.symbols_path,
             'timeout': self.timeout,
+            'socket_timeout': self.socket_timeout,
             'adb_host': self._adb_host,
             'adb_port': self._adb_port,
             'prefs': self.prefs,
         }
         if self.bin:
             kwargs.update({
                 'host': 'localhost',
                 'port': 2828,