Bug 1068429 - Log crashes with structured logging for those using structured logging.;r=ahal

This commit is contained in:
Chris Manchester 2014-09-23 20:33:31 -04:00
parent ee817ff08c
commit ab100f0c22
4 changed files with 33 additions and 12 deletions

View File

@ -16,6 +16,7 @@ import time
import traceback
from automation import Automation
from mozlog.structured import get_default_logger
from mozprocess import ProcessHandlerMixin
@ -114,7 +115,11 @@ class B2GRemoteAutomation(Automation):
local_dump_dir = tempfile.mkdtemp()
self._devicemanager.getDirectory(remote_dump_dir, local_dump_dir)
try:
crashed = mozcrash.check_for_crashes(local_dump_dir, symbolsPath, test_name=self.lastTestSeen)
logger = get_default_logger()
if logger is not None:
crashed = mozcrash.log_crashes(logger, local_dump_dir, symbolsPath, test=self.lastTestSeen)
else:
crashed = mozcrash.check_for_crashes(local_dump_dir, symbolsPath, test_name=self.lastTestSeen)
except:
traceback.print_exc()
finally:

View File

@ -13,6 +13,7 @@ import sys
from automation import Automation
from devicemanager import DMError
from mozlog.structured import get_default_logger
import mozcrash
# signatures for logcat messages that we don't care about much
@ -202,7 +203,12 @@ class RemoteAutomation(Automation):
# Whilst no crash was found, the run should still display as a failure
return True
self._devicemanager.getDirectory(remoteCrashDir, dumpDir)
crashed = Automation.checkForCrashes(self, dumpDir, symbolsPath)
logger = get_default_logger()
if logger is not None:
crashed = mozcrash.log_crashes(logger, dumpDir, symbolsPath, test=self.lastTestSeen)
else:
crashed = Automation.checkForCrashes(self, dumpDir, symbolsPath)
finally:
try:

View File

@ -1532,11 +1532,10 @@ class Mochitest(MochitestUtilsMixin):
# check for crashes
minidump_path = os.path.join(self.profile.profile, "minidumps")
crashed = mozcrash.check_for_crashes(minidump_path,
symbolsPath,
test_name=self.lastTestSeen)
crash_count = mozcrash.log_crashes(self.log, minidump_path, symbolsPath,
test=self.lastTestSeen)
if crashed or zombieProcesses:
if crash_count or zombieProcesses:
status = 1
finally:

View File

@ -8,6 +8,7 @@ import os
import subprocess
import traceback
from mozlog.structured import get_default_logger
from mozprocess import ProcessHandler
import mozcrash
@ -181,12 +182,22 @@ class BaseRunner(object):
self.crashed = False
try:
self.crashed = mozcrash.check_for_crashes(
dump_directory,
self.symbols_path,
dump_save_path=dump_save_path,
test_name=test_name,
quiet=quiet)
logger = get_default_logger()
if logger is not None:
if test_name is None:
test_name = "runner.py"
self.crashed = mozcrash.log_crashes(logger,
dump_directory,
self.symbols_path,
dump_save_path=dump_save_path,
test=test_name)
else:
self.crashed = mozcrash.check_for_crashes(
dump_directory,
self.symbols_path,
dump_save_path=dump_save_path,
test_name=test_name,
quiet=quiet)
except:
traceback.print_exc()