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

Unified Diff: appengine/cr-buildbucket/swarming/test/swarming_test.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
« no previous file with comments | « appengine/cr-buildbucket/swarming/swarming.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: appengine/cr-buildbucket/swarming/test/swarming_test.py
diff --git a/appengine/cr-buildbucket/swarming/test/swarming_test.py b/appengine/cr-buildbucket/swarming/test/swarming_test.py
index 72fd1b09ac9c78f1332f50a87efee4154fc6cbe0..a9f0e90d30ce7c62bfbd39af7e157a85b66090fb 100755
--- a/appengine/cr-buildbucket/swarming/test/swarming_test.py
+++ b/appengine/cr-buildbucket/swarming/test/swarming_test.py
@@ -148,10 +148,8 @@ class SwarmingTest(testing.AppengineTestCase):
validate_swarming_param(p)
def test_execution_timeout(self):
- builder_cfg = project_config_pb2.Swarming.Builder(
- name='fast-builder',
- execution_timeout_secs=60,
- )
+ self.bucket_cfg.swarming.common_execution_timeout_secs = 120
+ builder_cfg = project_config_pb2.Swarming.Builder(name='fast-builder')
build = model.Build(
bucket='bucket',
@@ -164,6 +162,12 @@ class SwarmingTest(testing.AppengineTestCase):
self.bucket_cfg.swarming, builder_cfg, build).get_result()
self.assertEqual(
+ task_def['properties']['execution_timeout_secs'], 120)
+
+ builder_cfg.execution_timeout_secs = 60
+ task_def = swarming.create_task_def_async(
+ self.bucket_cfg.swarming, builder_cfg, build).get_result()
+ self.assertEqual(
task_def['properties']['execution_timeout_secs'], 60)
def test_create_task_async(self):
@@ -372,8 +376,8 @@ class SwarmingTest(testing.AppengineTestCase):
'state': 'TIMED_OUT',
},
'status': model.BuildStatus.COMPLETED,
- 'result': model.BuildResult.CANCELED,
- 'cancelation_reason': model.CancelationReason.TIMEOUT,
+ 'result': model.BuildResult.FAILURE,
+ 'failure_reason': model.FailureReason.INFRA_FAILURE,
},
{
« no previous file with comments | « appengine/cr-buildbucket/swarming/swarming.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698