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

Unified Diff: appengine/findit/waterfall/try_job_util.py

Issue 2258373002: [Findit] Move configurable parameters in try_job_util.py to config (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Created 4 years, 4 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/findit/waterfall/test/wf_testcase.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: appengine/findit/waterfall/try_job_util.py
diff --git a/appengine/findit/waterfall/try_job_util.py b/appengine/findit/waterfall/try_job_util.py
index 71f2636a956eebab4c46825d8d22baf3848789a9..854265f00a05a21a8b1e15a39ed3f85bf6612a64 100644
--- a/appengine/findit/waterfall/try_job_util.py
+++ b/appengine/findit/waterfall/try_job_util.py
@@ -18,9 +18,6 @@ from model.wf_failure_group import WfFailureGroup
from model.wf_try_job import WfTryJob
from waterfall import waterfall_config
-# TODO(lijeffrey): Move this to config.
-MATCHING_GROUPS_SECONDS_AGO = 24 * 60 * 60 # 24 hours.
-
def _ShouldBailOutForOutdatedBuild(build):
return (time_util.GetUTCNow() - build.start_time).days > 0
@@ -186,7 +183,8 @@ def _GetOutputNodes(signals):
def _GetMatchingFailureGroups(build_failure_type):
earliest_time = time_util.GetUTCNow() - timedelta(
- seconds=MATCHING_GROUPS_SECONDS_AGO)
+ seconds=waterfall_config.GetTryJobSettings().get(
+ 'max_seconds_look_back_for_group'))
return WfFailureGroup.query(ndb.AND(
WfFailureGroup.created_time >= earliest_time,
WfFailureGroup.build_failure_type == build_failure_type)).fetch()
@@ -300,9 +298,9 @@ def _NeedANewTestTryJob(
if (not force_try_job and
waterfall_config.ShouldSkipTestTryJobs(master_name, builder_name)):
- logging.info('Test try jobs on %s, %s are not supported yet.',
- master_name, builder_name)
- return False
+ logging.info('Test try jobs on %s, %s are not supported yet.',
+ master_name, builder_name)
+ return False
return _CurrentBuildKeyInFailureResultMap(
master_name, builder_name, build_number)
@@ -328,11 +326,12 @@ def NeedANewTryJob(
'Try job will not be triggered.' % build.start_time)
return False
- need_new_try_job = (_NeedANewCompileTryJob(
- master_name, builder_name, build_number, failure_info)
- if try_job_type == failure_type.COMPILE else
- _NeedANewTestTryJob(
- master_name, builder_name, build_number, failure_info, force_try_job))
+ if try_job_type == failure_type.COMPILE:
+ need_new_try_job = _NeedANewCompileTryJob(
+ master_name, builder_name, build_number, failure_info)
+ else:
+ need_new_try_job = _NeedANewTestTryJob(
+ master_name, builder_name, build_number, failure_info, force_try_job)
if need_new_try_job:
# TODO(josiahk): Integrate this into need_new_try_job boolean
« no previous file with comments | « appengine/findit/waterfall/test/wf_testcase.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698