| Index: scripts/slave/recipe_modules/auto_bisect_staging/local_bisect.py
|
| diff --git a/scripts/slave/recipe_modules/auto_bisect_staging/local_bisect.py b/scripts/slave/recipe_modules/auto_bisect_staging/local_bisect.py
|
| index ac201e79cb711ce9464fb9db4e4d5a23d24e845a..9e6c3615a9080a19b08bc106ebbda58b97d7c4ba 100644
|
| --- a/scripts/slave/recipe_modules/auto_bisect_staging/local_bisect.py
|
| +++ b/scripts/slave/recipe_modules/auto_bisect_staging/local_bisect.py
|
| @@ -6,6 +6,7 @@ import base64
|
| import collections
|
| import json
|
|
|
| +from . import bisect_exceptions
|
|
|
| def perform_bisect(api, **flags):
|
| # Try catch all the exceptions thrown in bisection so that recipe can
|
| @@ -34,9 +35,13 @@ def perform_bisect(api, **flags):
|
| continue
|
| else:
|
| raise
|
| - except: # pylint: disable=bare-except
|
| + except bisect_exceptions.InconclusiveBisectException:
|
| if bisect_attempts:
|
| - bisect_attempts[-1].post_result(halt_on_failure=True)
|
| + bisect_attempts[-1].post_result()
|
| + raise api.m.step.StepFailure('Bisect cannot identify a culprit')
|
| + except Exception: # pylint: disable=bare-except
|
| + if bisect_attempts:
|
| + bisect_attempts[-1].post_result()
|
| raise
|
|
|
| def _perform_single_bisect(api, bisect_attempts, **flags):
|
| @@ -47,9 +52,10 @@ def _perform_single_bisect(api, bisect_attempts, **flags):
|
| bisector = api.create_bisector(bisect_config, **flags)
|
| bisect_attempts.append(bisector)
|
| with api.m.step.nest('Gathering reference values'):
|
| - _gather_reference_range(api, bisector)
|
| + _gather_reference_range(bisector)
|
| if (not bisector.failed and bisector.check_improvement_direction() and
|
| bisector.check_initial_confidence()):
|
| + bisector.compute_relative_change()
|
| if bisector.check_reach_adjacent_revision(
|
| bisector.good_rev): # pragma: no cover
|
| # Only show this step if bisect has reached adjacent revisions.
|
| @@ -68,22 +74,19 @@ def _get_connected_devices(api):
|
| api.m.chromium_android.device_status()
|
| return api.m.chromium_android.devices
|
|
|
| -def _gather_reference_range(api, bisector): # pragma: no cover
|
| +def _gather_reference_range(bisector): # pragma: no cover
|
| bisector.good_rev.start_job()
|
| bisector.bad_rev.start_job()
|
| - bisector.wait_for_all([bisector.good_rev, bisector.bad_rev])
|
| if bisector.good_rev.failed:
|
| bisector.surface_result('REF_RANGE_FAIL')
|
| - api.m.halt('Testing the "good" revision failed')
|
| bisector.failed = True
|
| + raise bisect_exceptions.InconclusiveBisectException(
|
| + 'Testing the "good" revision failed')
|
| elif bisector.bad_rev.failed:
|
| bisector.surface_result('REF_RANGE_FAIL')
|
| - api.m.halt('Testing the "bad" revision failed')
|
| bisector.failed = True
|
| - api.m.halt('Testing the "good" revision failed')
|
| - else:
|
| - bisector.compute_relative_change()
|
| -
|
| + raise bisect_exceptions.InconclusiveBisectException(
|
| + 'Testing the "bad" revision failed')
|
|
|
| def _bisect_main_loop(bisector): # pragma: no cover
|
| """This is the main bisect loop.
|
| @@ -101,7 +104,6 @@ def _bisect_main_loop(bisector): # pragma: no cover
|
| revision_to_check.revision_string())):
|
| bisector.post_result(halt_on_failure=False)
|
| revision_to_check.start_job()
|
| - bisector.wait_for(revision_to_check)
|
|
|
| if bisector.check_reach_adjacent_revision(revision_to_check):
|
| # Only show this step if bisect has reached adjacent revisions.
|
|
|