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

Unified Diff: appengine/cr-buildbucket/swarming/swarming.py

Issue 2096233002: swarmbucket: add bucket-level execution timeout (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: rebased Created 4 years, 6 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
Index: appengine/cr-buildbucket/swarming/swarming.py
diff --git a/appengine/cr-buildbucket/swarming/swarming.py b/appengine/cr-buildbucket/swarming/swarming.py
index 4a0f657e92f8c71d8a50f0867fb7d7ca7d8f19b2..d4970d747b035ba0e098871fb75e5a8666541f06 100644
--- a/appengine/cr-buildbucket/swarming/swarming.py
+++ b/appengine/cr-buildbucket/swarming/swarming.py
@@ -265,6 +265,10 @@ def create_task_def_async(swarming_cfg, builder_cfg, build):
swarming_cfg.common_dimensions,
builder_cfg.dimensions
)
+
+ if swarming_cfg.common_execution_timeout_secs > 0:
+ task_properties['execution_timeout_secs'] = (
+ swarming_cfg.common_execution_timeout_secs)
if builder_cfg.execution_timeout_secs > 0:
task_properties['execution_timeout_secs'] = (
builder_cfg.execution_timeout_secs)
@@ -418,9 +422,14 @@ def _update_build(build, result):
if state == 'CANCELED':
build.result = model.BuildResult.CANCELED
build.cancelation_reason = model.CancelationReason.CANCELED_EXPLICITLY
- elif state in ('TIMED_OUT', 'EXPIRED'):
+ elif state == 'EXPIRED':
+ # Task did not start.
build.result = model.BuildResult.CANCELED
build.cancelation_reason = model.CancelationReason.TIMEOUT
+ elif state == 'TIMED_OUT':
+ # Task started, but timed out.
+ build.result = model.BuildResult.FAILURE
+ build.failure_reason = model.FailureReason.INFRA_FAILURE
elif state == 'BOT_DIED' or result.get('internal_failure'):
build.result = model.BuildResult.FAILURE
build.failure_reason = model.FailureReason.INFRA_FAILURE
« no previous file with comments | « appengine/cr-buildbucket/proto/project_config_pb2.py ('k') | appengine/cr-buildbucket/swarming/test/swarming_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698