| OLD | NEW |
| 1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 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 datetime import datetime | 5 from datetime import datetime |
| 6 import json | 6 import json |
| 7 import time | 7 import time |
| 8 | 8 |
| 9 from google.appengine.ext import ndb | 9 from google.appengine.ext import ndb |
| 10 | 10 |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 | 211 |
| 212 if status == BuildbucketBuild.STARTED: | 212 if status == BuildbucketBuild.STARTED: |
| 213 try_job_result.status = analysis_status.RUNNING | 213 try_job_result.status = analysis_status.RUNNING |
| 214 try_job_result.put() | 214 try_job_result.put() |
| 215 return result_to_update | 215 return result_to_update |
| 216 | 216 |
| 217 # Arguments number differs from overridden method - pylint: disable=W0221 | 217 # Arguments number differs from overridden method - pylint: disable=W0221 |
| 218 # TODO(chanli): Handle try job for test failures later. | 218 # TODO(chanli): Handle try job for test failures later. |
| 219 def run( | 219 def run( |
| 220 self, master_name, builder_name, build_number, try_job_type, try_job_id): | 220 self, master_name, builder_name, build_number, try_job_type, try_job_id): |
| 221 assert try_job_id | 221 if not try_job_id: |
| 222 return None |
| 222 | 223 |
| 223 timeout_hours = waterfall_config.GetTryJobSettings().get( | 224 timeout_hours = waterfall_config.GetTryJobSettings().get( |
| 224 'job_timeout_hours') | 225 'job_timeout_hours') |
| 225 default_pipeline_wait_seconds = waterfall_config.GetTryJobSettings().get( | 226 default_pipeline_wait_seconds = waterfall_config.GetTryJobSettings().get( |
| 226 'server_query_interval_seconds') | 227 'server_query_interval_seconds') |
| 227 max_error_times = waterfall_config.GetTryJobSettings().get( | 228 max_error_times = waterfall_config.GetTryJobSettings().get( |
| 228 'allowed_response_error_times') | 229 'allowed_response_error_times') |
| 229 pipeline_wait_seconds = default_pipeline_wait_seconds | 230 pipeline_wait_seconds = default_pipeline_wait_seconds |
| 230 allowed_response_error_times = max_error_times | 231 allowed_response_error_times = max_error_times |
| 231 | 232 |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 282 _UpdateTryJobMetadata(try_job_data, start_time, build, error, True) | 283 _UpdateTryJobMetadata(try_job_data, start_time, build, error, True) |
| 283 # Explicitly abort the whole pipeline. | 284 # Explicitly abort the whole pipeline. |
| 284 raise pipeline.Abort( | 285 raise pipeline.Abort( |
| 285 'Try job %s timed out after %d hours.' % ( | 286 'Try job %s timed out after %d hours.' % ( |
| 286 try_job_id, timeout_hours)) | 287 try_job_id, timeout_hours)) |
| 287 | 288 |
| 288 # Ensure last_buildbucket_response is always the most recent | 289 # Ensure last_buildbucket_response is always the most recent |
| 289 # whenever available during intermediate queries. | 290 # whenever available during intermediate queries. |
| 290 _UpdateLastBuildbucketResponse(try_job_data, build) | 291 _UpdateLastBuildbucketResponse(try_job_data, build) |
| 291 | 292 |
| 292 time.sleep(pipeline_wait_seconds) # pragma: no cover | 293 time.sleep(pipeline_wait_seconds) # pragma: no cover |
| OLD | NEW |