Chromium Code Reviews| Index: scripts/slave/recipe_modules/bot_update/api.py |
| diff --git a/scripts/slave/recipe_modules/bot_update/api.py b/scripts/slave/recipe_modules/bot_update/api.py |
| index 17add359bb5ed1c2bf0014f9ff93322e6b925705..36a6a94b1e362b1b70a3fc16da9a2730933000a8 100644 |
| --- a/scripts/slave/recipe_modules/bot_update/api.py |
| +++ b/scripts/slave/recipe_modules/bot_update/api.py |
| @@ -208,8 +208,10 @@ class BotUpdateApi(recipe_api.RecipeApi): |
| # Ah hah! Now that everything is in place, lets run bot_update! |
| try: |
| - # 88 is the 'patch failure' return code. |
| - self(name, cmd, step_test_data=step_test_data, ok_ret=(0, 88), **kwargs) |
| + # 87 and 88 are the 'patch failure' codes for patch download and patch |
| + # apply, respectively. |
|
Sergiy Byelozyorov
2015/10/02 13:37:50
add a comment that we do not check them here, but
tandrii(chromium)
2015/10/02 13:49:44
Done.
|
| + self(name, cmd, step_test_data=step_test_data, |
| + ok_ret=(0, 87, 88), **kwargs) |
| finally: |
| step_result = self.m.step.active_result |
| self._properties = step_result.json.output.get('properties', {}) |
| @@ -232,10 +234,13 @@ class BotUpdateApi(recipe_api.RecipeApi): |
| # the checkout. |
| # If there is a patch failure, emit another step that said things failed. |
| if step_result.json.output.get('patch_failure'): |
| - # TODO(phajdan.jr): Differentiate between failure to download the patch |
| - # and failure to apply it. The first is an infra failure, the latter |
| - # a definite patch failure. |
| - self.m.tryserver.set_patch_failure_tryjob_result() |
| + return_code = step_result.json.output.get('patch_apply_return_code') |
| + if return_code == 3: |
|
Sergiy Byelozyorov
2015/10/02 13:06:35
now you also need to change 3 to 87
Sergiy Byelozyorov
2015/10/02 13:37:50
discussed offline... this is actually correct
|
| + # This is download failure, hence an infra failure. |
| + raise self.m.step.InfraFailure('Failed to download the patch') |
| + else: |
| + # This is actual patch failure. |
| + self.m.tryserver.set_patch_failure_tryjob_result() |
| self.m.python.failing_step( |
| 'Patch failure', 'Check the bot_update step for details') |