Bug 1187082 - Ensure talos always produces TALOSDATA json structure in logs so perfherder can ingest data. r=wlach
authorJulien Pagès <j.parkouss@gmail.com>
Wed, 02 Sep 2015 22:52:11 +0200
changeset 260628 f0a54b1e9b60dbebc13d91967a402067271b0946
parent 260627 71886d218c121ad55afdab457f728168630e086d
child 260629 0ff820964ea067091de3d6171577b6acb83f1cb9
push id29318
push usercbook@mozilla.com
push dateThu, 03 Sep 2015 11:15:07 +0000
treeherdermozilla-central@74fbd245369c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerswlach
bugs1187082
milestone43.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=wlach This synchronise the TALOSDATA regex with the one used in perfherder. Also this ensure that we only see that message once.
testing/mozharness/mozharness/mozilla/testing/talos.py
--- a/testing/mozharness/mozharness/mozilla/testing/talos.py
+++ b/testing/mozharness/mozharness/mozilla/testing/talos.py
@@ -36,22 +36,23 @@ 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+)'"''')
+    RE_TALOSDATA = re.compile(r'.*?TALOSDATA:\s+(\[.*\])')
     worst_tbpl_status = TBPL_SUCCESS
 
     def __init__(self, **kwargs):
         super(TalosOutputParser, self).__init__(**kwargs)
         self.minidump_output = None
-        self.found_talosdata = False
+        self.num_times_found_talosdata = 0
 
     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
         )
@@ -60,18 +61,18 @@ class TalosOutputParser(OutputParser):
         """ 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
+        if self.RE_TALOSDATA.match(line):
+            self.num_times_found_talosdata += 1
 
         # 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.update_worst_log_and_tbpl_levels(CRITICAL, TBPL_RETRY)
             return  # skip base parse_single_line
         super(TalosOutputParser, self).parse_single_line(line)
@@ -588,18 +589,19 @@ 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!")
+        if parser.num_times_found_talosdata != 1:
+            self.critical("TALOSDATA was seen %d times, expected 1."
+                          % parser.num_times_found_talosdata)
             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