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

Unified Diff: appengine/findit/waterfall/flake/initialize_flake_pipeline.py

Issue 2282093002: [Findit] Moving check flake max_builds_to_look_back to config (Closed)
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
Index: appengine/findit/waterfall/flake/initialize_flake_pipeline.py
diff --git a/appengine/findit/waterfall/flake/initialize_flake_pipeline.py b/appengine/findit/waterfall/flake/initialize_flake_pipeline.py
index c15d414e6247a52b564cc7dba25554e736250385..8bcaaf0772fb25d170630827f2a5ee9fa4491960 100644
--- a/appengine/findit/waterfall/flake/initialize_flake_pipeline.py
+++ b/appengine/findit/waterfall/flake/initialize_flake_pipeline.py
@@ -2,19 +2,15 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-from datetime import datetime
-
from google.appengine.ext import ndb
from common import appengine_util
from common import constants
from model import analysis_status
from model.flake.master_flake_analysis import MasterFlakeAnalysis
+from waterfall import waterfall_config
from waterfall.flake.recursive_flake_pipeline import RecursiveFlakePipeline
-# TODO(lijeffrey): Move to config.
-MAX_BUILD_NUMBERS_TO_LOOK_BACK = 1000
-
@ndb.transactional
def NeedANewAnalysis(
@@ -74,13 +70,16 @@ def ScheduleAnalysisIfNeeded(master_name, builder_name, build_number, step_name,
"""
if NeedANewAnalysis(
master_name, builder_name, build_number, step_name, test_name):
+ check_flake_settings = waterfall_config.GetCheckFlakeSettings()
+ max_build_numbers_to_look_back = check_flake_settings.get(
+ 'max_build_numbers_to_look_back')
flakiness_algorithm_results_dict = {
'flakes_in_a_row': 0,
'stable_in_a_row': 0,
'stabled_out': False,
'flaked_out': False,
'last_build_number': max(
- 0, build_number - MAX_BUILD_NUMBERS_TO_LOOK_BACK),
+ 0, build_number - max_build_numbers_to_look_back),
'lower_boundary': None,
'upper_boundary': None,
'lower_boundary_result': None,
« no previous file with comments | « appengine/findit/handlers/test/config_test.py ('k') | appengine/findit/waterfall/test/waterfall_config_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698