Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright 2016 The Chromium Authors. All rights reserved. | 1 # Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 from collections import defaultdict | 5 from collections import defaultdict |
| 6 import datetime | 6 import datetime |
| 7 import logging | 7 import logging |
| 8 import time | 8 import time |
| 9 | 9 |
| 10 from common.http_client_appengine import HttpClientAppengine as HttpClient | 10 from common.http_client_appengine import HttpClientAppengine as HttpClient |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 78 assert task_id | 78 assert task_id |
| 79 timeout_hours = waterfall_config.GetSwarmingSettings().get( | 79 timeout_hours = waterfall_config.GetSwarmingSettings().get( |
| 80 'task_timeout_hours') | 80 'task_timeout_hours') |
| 81 deadline = time.time() + timeout_hours * 60 * 60 | 81 deadline = time.time() + timeout_hours * 60 * 60 |
| 82 server_query_interval_seconds = waterfall_config.GetSwarmingSettings().get( | 82 server_query_interval_seconds = waterfall_config.GetSwarmingSettings().get( |
| 83 'server_query_interval_seconds') | 83 'server_query_interval_seconds') |
| 84 | 84 |
| 85 task_started = False | 85 task_started = False |
| 86 task_completed = False | 86 task_completed = False |
| 87 tests_statuses = {} | 87 tests_statuses = {} |
| 88 step_name_no_platform = step_name | |
|
stgao
2016/03/10 23:50:28
Should not default to step name for steps running
chanli
2016/03/11 00:49:41
I think we need to fall back to step name just in
stgao
2016/03/11 01:03:20
In which scenario do you think we need to fall bac
chanli
2016/03/11 03:47:00
Just for precaution.
stgao
2016/03/11 06:42:58
But the step names always includes the platform na
| |
| 88 | 89 |
| 89 while not task_completed: | 90 while not task_completed: |
| 90 # Keeps monitoring the swarming task, waits for it to complete. | 91 # Keeps monitoring the swarming task, waits for it to complete. |
| 91 data = swarming_util.GetSwarmingTaskResultById( | 92 data = swarming_util.GetSwarmingTaskResultById( |
| 92 task_id, self.HTTP_CLIENT) | 93 task_id, self.HTTP_CLIENT) |
| 93 task_state = data['state'] | 94 task_state = data['state'] |
| 95 step_name_no_platform = swarming_util.GetTagValue( | |
| 96 data.get('tags', {}), 'ref_name') or step_name | |
| 94 if task_state not in swarming_util.STATES_RUNNING: | 97 if task_state not in swarming_util.STATES_RUNNING: |
| 95 task_completed = True | 98 task_completed = True |
| 96 task = WfSwarmingTask.Get( | 99 task = WfSwarmingTask.Get( |
| 97 master_name, builder_name, build_number, step_name) | 100 master_name, builder_name, build_number, step_name) |
| 98 if task_state == swarming_util.STATE_COMPLETED: | 101 if task_state == swarming_util.STATE_COMPLETED: |
| 99 outputs_ref = data.get('outputs_ref') | 102 outputs_ref = data.get('outputs_ref') |
| 100 output_json = swarming_util.GetSwarmingTaskFailureLog( | 103 output_json = swarming_util.GetSwarmingTaskFailureLog( |
| 101 outputs_ref, self.HTTP_CLIENT) | 104 outputs_ref, self.HTTP_CLIENT) |
| 102 tests_statuses = _CheckTestsRunStatuses(output_json) | 105 tests_statuses = _CheckTestsRunStatuses(output_json) |
| 103 | 106 |
| (...skipping 29 matching lines...) Expand all Loading... | |
| 133 break # Stops the loop and return. | 136 break # Stops the loop and return. |
| 134 | 137 |
| 135 # Update swarming task metadate. | 138 # Update swarming task metadate. |
| 136 task = WfSwarmingTask.Get( | 139 task = WfSwarmingTask.Get( |
| 137 master_name, builder_name, build_number, step_name) | 140 master_name, builder_name, build_number, step_name) |
| 138 task.created_time = _ConvertDateTime(data.get('created_ts')) | 141 task.created_time = _ConvertDateTime(data.get('created_ts')) |
| 139 task.started_time = _ConvertDateTime(data.get('started_ts')) | 142 task.started_time = _ConvertDateTime(data.get('started_ts')) |
| 140 task.completed_time = _ConvertDateTime(data.get('completed_ts')) | 143 task.completed_time = _ConvertDateTime(data.get('completed_ts')) |
| 141 task.put() | 144 task.put() |
| 142 | 145 |
| 143 return step_name, task.classified_tests | 146 return step_name, (step_name_no_platform, task.classified_tests) |
| OLD | NEW |