diff options
author | jrg@chromium.org <jrg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-07 08:12:45 +0000 |
---|---|---|
committer | jrg@chromium.org <jrg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-07 08:12:45 +0000 |
commit | 199ff49e7e76999bc2cedaf735472de47d389536 (patch) | |
tree | e013573ba8c4209f9848a3d66ee679f58beb42c7 /build | |
parent | 91793ffad4a8e15e34ee57b4ffa7ef4c6a6951c3 (diff) | |
download | chromium_src-199ff49e7e76999bc2cedaf735472de47d389536.zip chromium_src-199ff49e7e76999bc2cedaf735472de47d389536.tar.gz chromium_src-199ff49e7e76999bc2cedaf735472de47d389536.tar.bz2 |
Android buildbot: be more tolerant of 'stuck' devices.
Be explicit about which device we are 'wait for boot'ing on. Also add
explicit timeout on wait-for-boot.
BUG=None
TEST=
Review URL: http://codereview.chromium.org/8831002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@113363 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'build')
-rwxr-xr-x | build/android/emulator.py | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/build/android/emulator.py b/build/android/emulator.py index b5e4436..681a3c1 100755 --- a/build/android/emulator.py +++ b/build/android/emulator.py @@ -81,12 +81,16 @@ class Emulator(object): # Signals we listen for to kill the emulator on _SIGNALS = (signal.SIGINT, signal.SIGHUP) - # Time to wait for an emulator launch, in seconds. - _EMULATOR_LAUNCH_TIMEOUT = 120 + # Time to wait for an emulator launch, in seconds. This includes + # the time to launch the emulator and a wait-for-device command. + _LAUNCH_TIMEOUT = 120 # Timeout interval of wait-for-device command before bouncing to a a # process life check. - _EMULATOR_WFD_TIMEOUT = 5 + _WAITFORDEVICE_TIMEOUT = 5 + + # Time to wait for a "wait for boot complete" (property set on device). + _WAITFORBOOT_TIMEOUT = 120 def __init__(self): try: @@ -137,26 +141,28 @@ class Emulator(object): seconds_waited = 0 number_of_waits = 2 # Make sure we can wfd twice adb_cmd = "adb -s %s %s" % (self.device, 'wait-for-device') - while seconds_waited < self._EMULATOR_LAUNCH_TIMEOUT: + while seconds_waited < self._LAUNCH_TIMEOUT: try: - run_command.RunCommand(adb_cmd, timeout_time=self._EMULATOR_WFD_TIMEOUT, + run_command.RunCommand(adb_cmd, + timeout_time=self._WAITFORDEVICE_TIMEOUT, retry_count=1) number_of_waits -= 1 if not number_of_waits: break except errors.WaitForResponseTimedOutError as e: - seconds_waited += self._EMULATOR_WFD_TIMEOUT + seconds_waited += self._WAITFORDEVICE_TIMEOUT adb_cmd = "adb -s %s %s" % (self.device, 'kill-server') run_command.RunCommand(adb_cmd) self.popen.poll() if self.popen.returncode != None: raise EmulatorLaunchException('EMULATOR DIED') - if seconds_waited >= self._EMULATOR_LAUNCH_TIMEOUT: + if seconds_waited >= self._LAUNCH_TIMEOUT: raise EmulatorLaunchException('TIMEOUT with wait-for-device') logging.info('Seconds waited on wait-for-device: %d', seconds_waited) # Now that we checked for obvious problems, wait for a boot complete. # Waiting for the package manager has been problematic. - a.Adb().WaitForBootComplete() + a.Adb().SetTargetSerial(self.device) + a.Adb().WaitForBootComplete(self._WAITFORBOOT_TIMEOUT) def Shutdown(self): """Shuts down the process started by launch.""" |