Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2282)

Unified Diff: appengine/findit/waterfall/process_base_swarming_task_result_pipeline.py

Issue 2312413002: [Findit] Record error if swarming task completes with exit_code as 2. (Closed)
Patch Set: Add None check to avoid keyvalue error (related change) Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | appengine/findit/waterfall/swarming_util.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: appengine/findit/waterfall/process_base_swarming_task_result_pipeline.py
diff --git a/appengine/findit/waterfall/process_base_swarming_task_result_pipeline.py b/appengine/findit/waterfall/process_base_swarming_task_result_pipeline.py
index 8b566bfabf53ad8b421defb07ac564a6682a1fc2..107c16b6dc2c5d024c4ff1f8c926f41d5cce134a 100644
--- a/appengine/findit/waterfall/process_base_swarming_task_result_pipeline.py
+++ b/appengine/findit/waterfall/process_base_swarming_task_result_pipeline.py
@@ -14,6 +14,9 @@ from waterfall import swarming_util
from waterfall import waterfall_config
+_ACCEPTED_EXIT_CODE = [0, 1]
lijeffrey 2016/09/08 03:41:00 nit: _ACCEPTED_EXIT_CODES on that note, how about
stgao 2016/09/08 04:16:00 +1 We also need comments for possible exit codes,
chanli 2016/09/08 21:16:56 Done.
chanli 2016/09/08 21:16:56 Since the name for each exit_code is self_explaine
+
+
class ProcessBaseSwarmingTaskResultPipeline(BasePipeline):
"""A pipeline for monitoring swarming task and processing task result.
@@ -86,12 +89,15 @@ class ProcessBaseSwarmingTaskResultPipeline(BasePipeline):
data = swarming_util.GetSwarmingTaskResultById(
task_id, self.HTTP_CLIENT)
task_state = data['state']
+ exit_code = (data['exit_code'] if
+ task_state == swarming_util.STATE_COMPLETED else None)
step_name_no_platform = swarming_util.GetTagValue(
data.get('tags', {}), 'ref_name')
if task_state not in swarming_util.STATES_RUNNING:
task_completed = True
task = self._GetSwarmingTask(*call_args)
- if task_state == swarming_util.STATE_COMPLETED:
+ if (task_state == swarming_util.STATE_COMPLETED and
+ int(exit_code) in _ACCEPTED_EXIT_CODE):
outputs_ref = data.get('outputs_ref')
output_json = swarming_util.GetSwarmingTaskFailureLog(
outputs_ref, self.HTTP_CLIENT)
@@ -101,8 +107,8 @@ class ProcessBaseSwarmingTaskResultPipeline(BasePipeline):
task.tests_statuses = tests_statuses
else:
task.status = analysis_status.ERROR
- logging.error('Swarming task stopped with status: %s' % (
- task_state))
+ logging.error('Swarming task stopped with status: %s and'
+ ' exit_code: %s' % (task_state, exit_code))
priority_str = swarming_util.GetTagValue(
data.get('tags', {}), 'priority')
if priority_str:
« no previous file with comments | « no previous file | appengine/findit/waterfall/swarming_util.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698