Bug 1592681 - Update raptor mozharness output parser to respect retry regex; r=perftest-reviewers,rwood
authorGeoff Brown <gbrown@mozilla.com>
Mon, 04 Nov 2019 16:41:12 +0000
changeset 500434 92675fb8d8298c7805bfe17131c6d67396da30cd
parent 500433 5a3b621d152d45ffc5b1f85e0129ef32ad8681b4
child 500435 3f664509986e0681c57c3de8454b30da748a7f20
push id114164
push useraiakab@mozilla.com
push dateTue, 05 Nov 2019 10:06:15 +0000
treeherdermozilla-inbound@4d585c7edc76 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersperftest-reviewers, rwood
bugs1592681
milestone72.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 1592681 - Update raptor mozharness output parser to respect retry regex; r=perftest-reviewers,rwood When certain strings are logged - "ADBTimeoutError", "INFRA-ERROR", etc - mozharness tasks usually retry: The task exits with TBPL_RETRY (4), is reported as "blue" in treeherder, and a new task is automatically started. This patch implements missing retry logic for raptor tasks, copying the logic from https://searchfox.org/mozilla-central/rev/59de675101da711520c0bb6e34a1ea2372e7ddbb/testing/mozharness/mozharness/mozilla/testing/unittest.py#169-174 Differential Revision: https://phabricator.services.mozilla.com/D51432
testing/mozharness/mozharness/mozilla/testing/raptor.py
--- a/testing/mozharness/mozharness/mozilla/testing/raptor.py
+++ b/testing/mozharness/mozharness/mozilla/testing/raptor.py
@@ -15,18 +15,19 @@ import sys
 import subprocess
 
 from shutil import copyfile
 
 import mozharness
 
 from mozharness.base.errors import PythonErrorList
 from mozharness.base.log import OutputParser, DEBUG, ERROR, CRITICAL, INFO
+from mozharness.mozilla.automation import TBPL_RETRY, TBPL_WORST_LEVEL_TUPLE
 from mozharness.mozilla.testing.android import AndroidMixin
-from mozharness.mozilla.testing.errors import HarnessErrorList
+from mozharness.mozilla.testing.errors import HarnessErrorList, TinderBoxPrintRe
 from mozharness.mozilla.testing.testbase import TestingMixin, testing_config_options
 from mozharness.base.vcs.vcsbase import MercurialScript
 from mozharness.mozilla.testing.codecoverage import (
     CodeCoverageMixin,
     code_coverage_config_options
 )
 
 scripts_path = os.path.abspath(os.path.dirname(os.path.dirname(mozharness.__file__)))
@@ -745,18 +746,26 @@ class Raptor(TestingMixin, MercurialScri
 class RaptorOutputParser(OutputParser):
     minidump_regex = re.compile(r'''raptorError: "error executing: '(\S+) (\S+) (\S+)'"''')
     RE_PERF_DATA = re.compile(r'.*PERFHERDER_DATA:\s+(\{.*\})')
 
     def __init__(self, **kwargs):
         super(RaptorOutputParser, self).__init__(**kwargs)
         self.minidump_output = None
         self.found_perf_data = []
+        self.harness_retry_re = TinderBoxPrintRe['harness_error']['retry_regex']
 
     def parse_single_line(self, line):
         m = self.minidump_regex.search(line)
         if m:
             self.minidump_output = (m.group(1), m.group(2), m.group(3))
 
         m = self.RE_PERF_DATA.match(line)
         if m:
             self.found_perf_data.append(m.group(1))
+
+        if self.harness_retry_re.search(line):
+            self.critical(' %s' % line)
+            self.worst_log_level = self.worst_level(CRITICAL, self.worst_log_level)
+            self.tbpl_status = self.worst_level(TBPL_RETRY, self.tbpl_status,
+                                                levels=TBPL_WORST_LEVEL_TUPLE)
+            return  # skip base parse_single_line
         super(RaptorOutputParser, self).parse_single_line(line)