Bug 1187082 - Ensure talos always produces TALOSDATA json structure in logs so perfherder can ingest data. r=jlund
authorJulien Pagès <j.parkouss@gmail.com>
Sat, 25 Jul 2015 15:29:55 +0200
changeset 286500 ea838fbd55184b713df890e2f2dbb8c291505d3d
parent 286499 21787f9ff39d369d17d7fd7d0ca7fdd4b87632de
child 286501 4fd14cf6b4154051f65bdaff453bc07ecadafeb5
push id5067
push userraliiev@mozilla.com
push dateMon, 21 Sep 2015 14:04:52 +0000
treeherdermozilla-beta@14221ffe5b2f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjlund
bugs1187082
milestone42.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 1187082 - Ensure talos always produces TALOSDATA json structure in logs so perfherder can ingest data. r=jlund
testing/mozharness/mozharness/mozilla/testing/talos.py
--- a/testing/mozharness/mozharness/mozilla/testing/talos.py
+++ b/testing/mozharness/mozharness/mozilla/testing/talos.py
@@ -36,38 +36,48 @@ TalosErrorList = PythonErrorList + [
      'level': CRITICAL,
      'explanation': r"""Most likely the browser failed to launch, or the test was otherwise unsuccessful in even starting."""},
 ]
 
 # TODO: check for running processes on script invocation
 
 class TalosOutputParser(OutputParser):
     minidump_regex = re.compile(r'''talosError: "error executing: '(\S+) (\S+) (\S+)'"''')
-    minidump_output = None
     worst_tbpl_status = TBPL_SUCCESS
 
+    def __init__(self, **kwargs):
+        super(TalosOutputParser, self).__init__(**kwargs)
+        self.minidump_output = None
+        self.found_talosdata = False
+
+    def update_worst_log_and_tbpl_levels(self, log_level, tbpl_level):
+        self.worst_log_level = self.worst_level(log_level,
+                                                self.worst_log_level)
+        self.worst_tbpl_status = self.worst_level(
+            tbpl_level, self.worst_tbpl_status,
+            levels=TBPL_WORST_LEVEL_TUPLE
+        )
+
     def parse_single_line(self, line):
         """ In Talos land, every line that starts with RETURN: needs to be
         printed with a TinderboxPrint:"""
         if line.startswith("RETURN:"):
             line.replace("RETURN:", "TinderboxPrint:")
         m = self.minidump_regex.search(line)
         if m:
             self.minidump_output = (m.group(1), m.group(2), m.group(3))
 
+        if line.startswith('INFO : TALOSDATA: '):
+            self.found_talosdata = True
+
         # now let's check if buildbot should retry
         harness_retry_re = TinderBoxPrintRe['harness_error']['retry_regex']
         if harness_retry_re.search(line):
             self.critical(' %s' % line)
-            self.worst_log_level = self.worst_level(CRITICAL,
-                                                    self.worst_log_level)
-            self.worst_tbpl_status = self.worst_level(
-                TBPL_RETRY, self.worst_tbpl_status,
-                levels=TBPL_WORST_LEVEL_TUPLE
-            )
+            self.update_worst_log_and_tbpl_levels(CRITICAL, TBPL_RETRY)
             return  # skip base parse_single_line
         super(TalosOutputParser, self).parse_single_line(line)
 
 
 talos_config_options = [
     [["-a", "--tests"],
      {'action': 'extend',
       "dest": "tests",
@@ -589,28 +599,27 @@ class Talos(TestingMixin, MercurialScrip
         self.return_code = self.run_command(command, cwd=self.workdir,
                                             output_timeout=output_timeout,
                                             output_parser=parser,
                                             env=env)
         if parser.minidump_output:
             self.info("Looking at the minidump files for debugging purposes...")
             for item in parser.minidump_output:
                 self.run_command(["ls", "-l", item])
+        if not parser.found_talosdata:
+            self.critical("No talos data in output!")
+            parser.update_worst_log_and_tbpl_levels(WARNING, TBPL_WARNING)
+
         if self.return_code not in [0]:
             # update the worst log level and tbpl status
             log_level = ERROR
             tbpl_level = TBPL_FAILURE
             if self.return_code == 1:
                 log_level = WARNING
                 tbpl_level = TBPL_WARNING
             if self.return_code == 4:
                 log_level = WARNING
                 tbpl_level = TBPL_RETRY
 
-            parser.worst_log_level = parser.worst_level(
-                log_level, parser.worst_log_level
-            )
-            parser.worst_tbpl_status = parser.worst_level(
-                tbpl_level, parser.worst_tbpl_status,
-                levels=TBPL_WORST_LEVEL_TUPLE
-            )
+            parser.update_worst_log_and_tbpl_levels(log_level, tbpl_level)
+
         self.buildbot_status(parser.worst_tbpl_status,
                              level=parser.worst_log_level)