Chromium Code Reviews| 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 9ffab76655aaeb27bc47c3767cd8f5e35eb6f2f7..eb0959404410d30a5f502b81f6f624b71cc8d93c 100644 |
| --- a/appengine/findit/waterfall/flake/initialize_flake_pipeline.py |
| +++ b/appengine/findit/waterfall/flake/initialize_flake_pipeline.py |
| @@ -9,10 +9,12 @@ from google.appengine.ext import ndb |
| from common import appengine_util |
| from common import constants |
| from model import analysis_status |
| -from model.flake.flake_swarming_task import FlakeSwarmingTask |
| from model.flake.master_flake_analysis import MasterFlakeAnalysis |
| from waterfall.flake.recursive_flake_pipeline import RecursiveFlakePipeline |
| +# TODO(lijeffrey): Move to config. |
| +BUILD_NUMBERS_BACK = 1000 |
| + |
| @ndb.transactional |
| def NeedANewAnalysis( |
| @@ -27,7 +29,7 @@ def NeedANewAnalysis( |
| True if an analysis is needed, otherwise False. |
| """ |
| master_flake_analysis = MasterFlakeAnalysis.Get( |
| - master_name, builder_name, build_number,step_name, test_name) |
| + master_name, builder_name, build_number, step_name, test_name) |
| if not master_flake_analysis: |
| master_flake_analysis = MasterFlakeAnalysis.Create( |
| @@ -50,6 +52,7 @@ def NeedANewAnalysis( |
| master_flake_analysis.put() |
| return True |
| + |
| # Unused arguments - pylint: disable=W0612, W0613 |
| def ScheduleAnalysisIfNeeded(master_name, builder_name, build_number, step_name, |
| test_name, force=False, |
| @@ -71,9 +74,16 @@ def ScheduleAnalysisIfNeeded(master_name, builder_name, build_number, step_name, |
| """ |
| if NeedANewAnalysis( |
| master_name, builder_name, build_number, step_name, test_name): |
| + algo_dict = { |
|
lijeffrey
2016/08/11 22:22:25
not quite sure why you chose this name for this va
caiw
2016/08/13 00:09:15
it's a dictionary which keeps track of numbers use
|
| + 'flakes_in_a_row': 0, |
| + 'stable_in_a_row': 0, |
| + 'stabled_out': False, |
| + 'flaked_out': False, |
| + 'last_build_number': max(0, build_number - BUILD_NUMBERS_BACK) |
| + } |
| pipeline_job = RecursiveFlakePipeline( |
| master_name, builder_name, build_number, step_name, test_name, |
| - master_build_number=build_number) |
| + master_build_number=build_number, algo_dict=algo_dict) |
| pipeline_job.target = appengine_util.GetTargetNameForModule( |
| constants.WATERFALL_BACKEND) |
| pipeline_job.start(queue_name=queue_name) |