Bug 1211608 - talos: error when trying to extract minidump from browser hang on windows. r=jmaher

This commit is contained in:
Julien Pagès 2015-10-05 21:29:37 +02:00
parent ad32f45a98
commit 02fb8bcdee
2 changed files with 12 additions and 7 deletions

View File

@ -53,7 +53,8 @@ class Reader(object):
self.output.append(line)
def run_browser(command, timeout=None, on_started=None, **kwargs):
def run_browser(command, minidump_dir, timeout=None, on_started=None,
**kwargs):
"""
Run the browser using the given `command`.
@ -64,6 +65,9 @@ def run_browser(command, timeout=None, on_started=None, **kwargs):
the end. If this is not possible, an exception will be raised.
:param command: the commad (as a string list) to run the browser
:param minidump_dir: a path where to extract minidumps in case the
browser hang. This have to be the same value
used in `mozcrash.check_for_crashes`.
:param timeout: if specified, timeout to wait for the browser before
we raise a :class:`TalosError`
:param on_started: a callback that can be used to do things just after
@ -92,7 +96,7 @@ def run_browser(command, timeout=None, on_started=None, **kwargs):
# or the browser just terminated - or we have a timeout
if not event.wait(timeout):
# try to extract the minidump stack if the browser hangs
mozcrash.kill_and_get_minidump(proc.pid)
mozcrash.kill_and_get_minidump(proc.pid, minidump_dir)
raise TalosError("timeout")
if reader.got_end_timestamp:
for i in range(1, wait_for_quit_timeout):

View File

@ -33,13 +33,12 @@ from talos.cmanager import CounterManagement
class TTest(object):
platform_type = utils.PLATFORM_TYPE
def check_for_crashes(self, browser_config, profile_dir, test_name):
def check_for_crashes(self, browser_config, minidump_dir, test_name):
# check for minidumps
minidumpdir = os.path.join(profile_dir, 'minidumps')
found = mozcrash.check_for_crashes(minidumpdir,
found = mozcrash.check_for_crashes(minidump_dir,
browser_config['symbols_path'],
test_name=test_name)
mozfile.remove(minidumpdir)
mozfile.remove(minidump_dir)
if found:
raise TalosCrash("Found crashes after test run, terminating test")
@ -62,6 +61,7 @@ class TTest(object):
return self._runTest(browser_config, test_config, setup)
def _runTest(self, browser_config, test_config, setup):
minidump_dir = os.path.join(setup.profile_dir, 'minidumps')
counters = test_config.get(self.platform_type + 'counters', [])
resolution = test_config['resolution']
@ -165,6 +165,7 @@ class TTest(object):
try:
pcontext = run_browser(
command_args,
minidump_dir,
timeout=timeout,
env=setup.env,
# start collecting counters as soon as possible
@ -235,7 +236,7 @@ class TTest(object):
if setup.sps_profile:
setup.sps_profile.symbolicate(i)
self.check_for_crashes(browser_config, setup.profile_dir,
self.check_for_crashes(browser_config, minidump_dir,
test_config['name'])
# include global (cross-cycle) counters