Bug 1270144 - fix message from timed out tests to indicate the following crash is caused by us terminating the browser process, r?ahal,RyanVM
MozReview-Commit-ID: Hyr7xkZdbqc
--- a/build/automation.py.in
+++ b/build/automation.py.in
@@ -448,21 +448,23 @@ class Automation(object):
self.dumpScreen(utilityPath)
(line, didTimeout) = self.readWithTimeout(logsource, timeout)
if not hitMaxTime and maxTime and datetime.now() - startTime > timedelta(seconds = maxTime):
# Kill the application.
hitMaxTime = True
self.log.info("TEST-UNEXPECTED-FAIL | %s | application ran for longer than allowed maximum time of %d seconds", self.lastTestSeen, int(maxTime))
+ self.log.warning("Now proceeding to terminate process(es).");
self.killAndGetStack(proc.pid, utilityPath, debuggerInfo)
if didTimeout:
if line:
self.log.info(line.rstrip().decode("UTF-8", "ignore"))
self.log.info("TEST-UNEXPECTED-FAIL | %s | application timed out after %d seconds with no output", self.lastTestSeen, int(timeout))
+ self.log.warning("Now proceeding to terminate process(es).");
if browserProcessId == -1:
browserProcessId = proc.pid
self.killAndGetStack(browserProcessId, utilityPath, debuggerInfo)
status = proc.wait()
printstatus("Main app process", status)
if status == 0:
self.lastTestSeen = "Main app process exited normally"
--- a/layout/tools/reftest/runreftest.py
+++ b/layout/tools/reftest/runreftest.py
@@ -499,16 +499,17 @@ class RefTest(object):
return int(any(t.retcode != 0 for t in threads))
def handleTimeout(self, timeout, proc, utilityPath, debuggerInfo):
"""handle process output timeout"""
# TODO: bug 913975 : _processOutput should call self.processOutputLine
# one more time one timeout (I think)
self.log.error("%s | application timed out after %d seconds with no output" % (self.lastTestSeen, int(timeout)))
+ self.log.warning("Now proceeding to terminate process(es).");
self.killAndGetStack(
proc, utilityPath, debuggerInfo, dump_screen=not debuggerInfo)
def dumpScreen(self, utilityPath):
if self.haveDumpedScreen:
self.log.info("Not taking screenshot here: see the one that was previously logged")
return
self.haveDumpedScreen = True
--- a/layout/tools/reftest/runreftestmulet.py
+++ b/layout/tools/reftest/runreftestmulet.py
@@ -157,16 +157,17 @@ class MuletReftest(RefTest):
if self.build_type == "mulet":
args += ['-chrome', 'chrome://b2g/content/shell.html']
return cmd, args
def _on_timeout(self):
msg = "%s | application timed out after %s seconds with no output"
self.log.testFail(msg % (self.last_test, self.timeout))
+ self.log.warning("Now proceeding to terminate process(es).");
# kill process to get a stack
self.runner.stop(sig=signal.SIGABRT)
def _unlockScreen(self):
self.marionette.set_context(self.marionette.CONTEXT_CONTENT)
self.marionette.import_script(os.path.abspath(
os.path.join(__file__, os.path.pardir, "gaia_lock_screen.js")))
--- a/testing/mochitest/runtests.py
+++ b/testing/mochitest/runtests.py
@@ -2441,16 +2441,17 @@ class MochitestDesktop(MochitestBase):
"""handle process output timeout"""
# TODO: bug 913975 : _processOutput should call self.processOutputLine
# one more time one timeout (I think)
error_message = "TEST-UNEXPECTED-TIMEOUT | %s | application timed out after %d seconds with no output" % (
self.lastTestSeen, int(timeout))
self.message_logger.dump_buffered()
self.message_logger.buffering = False
self.log.info(error_message)
+ self.log.warning("Now proceeding to terminate process(es).");
browser_pid = browser_pid or proc.pid
child_pids = self.extract_child_pids(processLog, browser_pid)
self.log.info('Found child pids: %s' % child_pids)
if HAVE_PSUTIL:
child_procs = [psutil.Process(pid) for pid in child_pids]
for pid in child_pids: