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

Unified Diff: appengine/findit/handlers/flake/check_flake.py

Issue 2510223003: [Findit] Fixing analysis mismatch in check flake (Closed)
Patch Set: rebase Created 4 years, 1 month 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 | « no previous file | appengine/findit/handlers/flake/test/check_flake_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: appengine/findit/handlers/flake/check_flake.py
diff --git a/appengine/findit/handlers/flake/check_flake.py b/appengine/findit/handlers/flake/check_flake.py
index 045583227d34259f59e62a16125fe14a53fb1a2f..fedd50f0734f23bedc20e7d13d595f0cd6f63849 100644
--- a/appengine/findit/handlers/flake/check_flake.py
+++ b/appengine/findit/handlers/flake/check_flake.py
@@ -2,6 +2,8 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+import logging
+
from google.appengine.api import users
from google.appengine.ext import ndb
@@ -101,7 +103,7 @@ class CheckFlake(BaseHandler):
request, user_email, is_admin, triggering_sources.FINDIT_UI)
analysis = MasterFlakeAnalysis.GetVersion(
- master_name, builder_name, build_number, step_name, test_name)
+ master_name, builder_name, build_number, step_name, test_name)
if not analysis:
if scheduled is None:
@@ -122,9 +124,7 @@ class CheckFlake(BaseHandler):
# the results from that analysis.
request = FlakeAnalysisRequest.GetVersion(key=test_name)
- if request and request.analyses:
- analysis = request.analyses[-1].get()
- else:
+ if not request:
return {
'template': 'error.html',
'data': {
@@ -136,6 +136,19 @@ class CheckFlake(BaseHandler):
'return_code': 400,
}
+ analysis = request.FindMatchingAnalysisForConfiguration(
+ master_name, builder_name)
+
+ if not analysis: # pragma: no cover
+ logging.error('Flake analysis was deleted unexpectedly!')
+ return {
+ 'template': 'error.html',
+ 'data': {
+ 'error_message': 'Flake analysis was deleted unexpectedly!',
+ },
+ 'return_code': 400
+ }
+
suspected_flake = _GetSuspectedFlakeAnalysisAndTriageResult(analysis)
data = {
« no previous file with comments | « no previous file | appengine/findit/handlers/flake/test/check_flake_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698