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 import copy | 5 import copy |
| 6 import logging | 6 import logging |
| 7 import time | 7 import time |
| 8 | 8 |
| 9 from common.http_client_appengine import HttpClientAppengine as HttpClient | 9 from common.http_client_appengine import HttpClientAppengine as HttpClient |
| 10 from common.pipeline_wrapper import BasePipeline | 10 from common.pipeline_wrapper import BasePipeline |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 161 ref_task_id, http_client) | 161 ref_task_id, http_client) |
| 162 | 162 |
| 163 # 2. Update/Overwrite parameters for the re-run. | 163 # 2. Update/Overwrite parameters for the re-run. |
| 164 iterations_to_rerun = self._GetIterationsToRerun() | 164 iterations_to_rerun = self._GetIterationsToRerun() |
| 165 | 165 |
| 166 new_request = self._CreateNewSwarmingTaskRequest( | 166 new_request = self._CreateNewSwarmingTaskRequest( |
| 167 ref_task_id, ref_request, master_name, builder_name, build_number, | 167 ref_task_id, ref_request, master_name, builder_name, build_number, |
| 168 step_name, tests, iterations_to_rerun) | 168 step_name, tests, iterations_to_rerun) |
| 169 | 169 |
| 170 # 3. Trigger a new Swarming task to re-run the failed tests. | 170 # 3. Trigger a new Swarming task to re-run the failed tests. |
| 171 task_id = swarming_util.TriggerSwarmingTask(new_request, http_client) | 171 task_id, error = swarming_util.TriggerSwarmingTask(new_request, http_client) |
| 172 | 172 |
| 173 # Save the task id. | 173 # Save the task id. |
| 174 swarming_task = self._GetSwarmingTask(*call_args) | 174 swarming_task = self._GetSwarmingTask(*call_args) |
| 175 swarming_task.task_id = task_id | 175 swarming_task.task_id = task_id |
|
chanli
2016/11/11 00:05:13
If the swarming_task is not even triggered, should
lijeffrey
2016/11/11 20:55:41
I think we can still save the parameters, but they
| |
| 176 if error: | |
| 177 swarming_task.error = error | |
| 176 swarming_task.parameters['tests'] = tests | 178 swarming_task.parameters['tests'] = tests |
| 177 swarming_task.parameters['iterations_to_rerun'] = iterations_to_rerun | 179 swarming_task.parameters['iterations_to_rerun'] = iterations_to_rerun |
| 178 swarming_task.parameters['ref_name'] = swarming_util.GetTagValue( | 180 swarming_task.parameters['ref_name'] = swarming_util.GetTagValue( |
| 179 new_request.tags, 'ref_name') | 181 new_request.tags, 'ref_name') |
| 180 swarming_task.put() | 182 swarming_task.put() |
| 181 | 183 |
| 182 logging.info('A Swarming task was triggered:%s', task_id) | 184 logging.info('A Swarming task was triggered:%s', task_id) |
|
chanli
2016/11/11 00:05:13
If error, we shouldn't have this log.
lijeffrey
2016/11/11 20:55:41
Done.
| |
| 183 return task_id | 185 return task_id |
| OLD | NEW |