Bug 1075647 - [mozrunner] Keep track of crashes detected during the life of the runner. r=ahalberstadt
authorDave Hunt <dhunt@mozilla.com>
Wed, 01 Oct 2014 10:29:00 -0400
changeset 231918 7ab5a95c4676b628ecf5db52273ba800d04a30bc
parent 231917 645d5e930e2348f9f67b816c20b7f6cacdc782af
child 231919 60e90dd7f64f8d0fea7661370c01dea74f102261
push id4187
push userbhearsum@mozilla.com
push dateFri, 28 Nov 2014 15:29:12 +0000
treeherdermozilla-beta@f23cc6a30c11 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersahalberstadt
bugs1075647
milestone35.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 1075647 - [mozrunner] Keep track of crashes detected during the life of the runner. r=ahalberstadt
testing/mozbase/mozrunner/mozrunner/base/runner.py
--- a/testing/mozbase/mozrunner/mozrunner/base/runner.py
+++ b/testing/mozbase/mozrunner/mozrunner/base/runner.py
@@ -41,17 +41,17 @@ class BaseRunner(object):
         else:
             self.env = env.copy()
 
         self.clean_profile = clean_profile
         self.process_class = process_class or ProcessHandler
         self.process_args = process_args or {}
         self.symbols_path = symbols_path
 
-        self.crashed = False
+        self.crashed = 0
 
     def __del__(self):
         self.cleanup()
 
     @abstractproperty
     def command(self):
         """Returns the command list to run."""
         pass
@@ -95,16 +95,17 @@ class BaseRunner(object):
         if interactive:
             self.process_handler = subprocess.Popen(cmd, env=self.env)
             # TODO: other arguments
         else:
             # this run uses the managed processhandler
             self.process_handler = self.process_class(cmd, env=self.env, **self.process_args)
             self.process_handler.run(self.timeout, self.output_timeout)
 
+        self.crashed = 0
         return self.process_handler.pid
 
     def wait(self, timeout=None):
         """
         Wait for the process to exit.
 
         :param timeout: if not None, will return after timeout seconds.
                         Timeout is ignored if interactive was set to True.
@@ -175,34 +176,36 @@ class BaseRunner(object):
         :param dump_save_path: Directory to save the minidump files to
         :param test_name: Name to use in the crash output
         :param quiet: If `True` don't print the PROCESS-CRASH message to stdout
         :returns: True if a crash was detected, otherwise False
         """
         if not dump_directory:
             dump_directory = os.path.join(self.profile.profile, 'minidumps')
 
-        self.crashed = False
         try:
             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)
+                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(
+                crashed = mozcrash.check_for_crashes(
                     dump_directory,
                     self.symbols_path,
                     dump_save_path=dump_save_path,
                     test_name=test_name,
                     quiet=quiet)
+                if crashed:
+                    self.crashed += 1
         except:
             traceback.print_exc()
 
         return self.crashed
 
     def cleanup(self):
         """
         Cleanup all runner state