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

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

Issue 2227223002: [Findit] Fix 1500 byte cap on failed_steps_and_tests and output_nodes (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Added . 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/model/wf_failure_group.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 eaa4209bf663a6f600d080d825e16ffdbfdb6733..3053ef4cd29bccc3feaa7aecc3cd33b9cc072511 100644
--- a/appengine/findit/waterfall/try_job_util.py
+++ b/appengine/findit/waterfall/try_job_util.py
@@ -3,6 +3,7 @@
# found in the LICENSE file.
from datetime import datetime
+from datetime import timedelta
import logging
from google.appengine.ext import ndb
@@ -19,6 +20,9 @@ from waterfall import swarming_tasks_to_try_job_pipeline
from waterfall import waterfall_config
from waterfall.try_job_type import TryJobType
+# TODO(lijeffrey): Move this to config.
+MATCHING_GROUPS_SECONDS_AGO = 24 * 60 * 60 # 24 hours.
+
def _CheckFailureForTryJobKey(
master_name, builder_name, build_number,
@@ -196,6 +200,7 @@ def _CreateBuildFailureGroup(
master_name, builder_name, build_number, build_failure_type, blame_list,
suspected_tuples, output_nodes=None, failed_steps_and_tests=None):
new_group = WfFailureGroup.Create(master_name, builder_name, build_number)
+ new_group.created_time = datetime.utcnow()
new_group.build_failure_type = build_failure_type
new_group.blame_list = blame_list
new_group.suspected_tuples = suspected_tuples
@@ -221,19 +226,24 @@ def _GetOutputNodes(signals):
return signals['compile'].get('failed_output_nodes', [])
+def _GetMatchingFailureGroups(build_failure_type):
+ earliest_time = datetime.utcnow() - timedelta(
+ seconds=MATCHING_GROUPS_SECONDS_AGO)
+ return WfFailureGroup.query(ndb.AND(
+ WfFailureGroup.created_time >= earliest_time,
+ WfFailureGroup.build_failure_type == build_failure_type)).fetch()
+
+
def _GetMatchingCompileFailureGroups(output_nodes):
+ groups = _GetMatchingFailureGroups(failure_type.COMPILE)
# Output nodes should already be unique and sorted.
- return WfFailureGroup.query(ndb.AND(
- WfFailureGroup.build_failure_type == failure_type.COMPILE,
- WfFailureGroup.output_nodes == output_nodes
- )).fetch()
+ return [group for group in groups if group.output_nodes == output_nodes]
def _GetMatchingTestFailureGroups(failed_steps_and_tests):
- return WfFailureGroup.query(ndb.AND(
- WfFailureGroup.build_failure_type == failure_type.TEST,
- WfFailureGroup.failed_steps_and_tests == failed_steps_and_tests
- )).fetch()
+ groups = _GetMatchingFailureGroups(failure_type.TEST)
+ return [group for group in groups
+ if group.failed_steps_and_tests == failed_steps_and_tests]
def _IsBuildFailureUniqueAcrossPlatforms(
@@ -318,7 +328,6 @@ def _NeedANewTryJob(
'step', master_name, builder_name, build_number, failure_result_map,
failed_steps))
-
need_new_try_job = (
need_new_try_job and ReviveOrCreateTryJobEntity(
master_name, builder_name, build_number, force_try_job))
« no previous file with comments | « appengine/findit/model/wf_failure_group.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698