Bug 1605239 - Exit raptor tasks with error when parser detects errors; r=perftest-reviewers,rwood

Previously, raptor mozharness jobs always exited with the return code of the
raptor test harness. With this patch, the mozharness job will exit with the
return code of the log parser, if the parser detects an error. This enables,
for example, exiting with TBPL_RETRY and triggering a task retry when the
test harness reports an ADBTimeoutError or similar.

Differential Revision: https://phabricator.services.mozilla.com/D58011

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Geoff Brown 2019-12-23 17:27:42 +00:00
Родитель c028f5125c
Коммит 3cd4a58405
1 изменённых файлов: 12 добавлений и 1 удалений

Просмотреть файл

@ -20,7 +20,9 @@ import mozharness
from mozharness.base.errors import PythonErrorList
from mozharness.base.log import OutputParser, DEBUG, ERROR, CRITICAL, INFO
from mozharness.mozilla.automation import TBPL_SUCCESS, TBPL_RETRY, TBPL_WORST_LEVEL_TUPLE
from mozharness.mozilla.automation import (
EXIT_STATUS_DICT, TBPL_SUCCESS, TBPL_RETRY, TBPL_WORST_LEVEL_TUPLE
)
from mozharness.mozilla.testing.android import AndroidMixin
from mozharness.mozilla.testing.errors import HarnessErrorList, TinderBoxPrintRe
from mozharness.mozilla.testing.testbase import TestingMixin, testing_config_options
@ -787,6 +789,15 @@ class Raptor(TestingMixin, MercurialScript, CodeCoverageMixin, AndroidMixin):
self.info(str(dest))
self._artifact_perf_data(src, dest)
# Allow log failures to over-ride successful runs of the test harness and
# give log failures priority, so that, for instance, log failures resulting
# in TBPL_RETRY cause a retry rather than simply reporting an error.
if parser.tbpl_status != TBPL_SUCCESS:
parser_status = EXIT_STATUS_DICT[parser.tbpl_status]
self.info('return code %s changed to %s due to log output' %
(str(self.return_code), str(parser_status)))
self.return_code = parser_status
class RaptorOutputParser(OutputParser):
minidump_regex = re.compile(r'''raptorError: "error executing: '(\S+) (\S+) (\S+)'"''')