From 65e8a713f39d2f4acf8d1e89235b83ef6d790f97 Mon Sep 17 00:00:00 2001 From: Kevin Lubick Date: Wed, 15 Feb 2017 10:08:51 -0500 Subject: Fix Nexus 10s from shutting down too often BUG=skia: Change-Id: I373bb62c6894569a2672745ce20aa351c5893968 Reviewed-on: https://skia-review.googlesource.com/8486 Commit-Queue: Kevin Lubick Reviewed-by: Ravi Mistry --- infra/bots/recipe_modules/flavor/gn_android_flavor.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'infra/bots/recipe_modules/flavor') diff --git a/infra/bots/recipe_modules/flavor/gn_android_flavor.py b/infra/bots/recipe_modules/flavor/gn_android_flavor.py index a994f74bcc..5b71823612 100644 --- a/infra/bots/recipe_modules/flavor/gn_android_flavor.py +++ b/infra/bots/recipe_modules/flavor/gn_android_flavor.py @@ -155,10 +155,15 @@ class GNAndroidFlavorUtils(default_flavor.DefaultFlavorUtils): args=[self.m.vars.skia_out.join(self.m.vars.configuration)], infra_step=True) - for f in self.m.run.failed_steps: - if isinstance(f, recipe_api.InfraFailure): - self._adb('shut down device to quarantine bot', 'shell', 'reboot', '-p') - break + # Only shutdown the device and quarantine the bot if the first failed step + # is an infra step. If, instead, we did this for any infra failures, we + # would shutdown too much. For example, if a Nexus 10 died during dm + # and the following pull step would also fail "device not found" - causing + # us to run the shutdown command when the device was probably not in a + # broken state; it was just rebooting. + if (self.m.run.failed_steps and + isinstance(self.m.run.failed_steps[0], recipe_api.InfraFailure)): + self._adb('shut down device to quarantine bot', 'shell', 'reboot', '-p') if self._ever_ran_adb: self._adb('kill adb server', 'kill-server') -- cgit v1.2.3