| 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 = {
|
|
|