Commit dd12ca97 authored by tonyg@chromium.org's avatar tonyg@chromium.org

Allow provision_devices to work on the L-release preview.

We weren't respecting the full timeout specified by the Reboot() method. And
apparently timing is different enough on the L-release preview that reboots
get stuck forever without the timeout.

BUG=389362

Review URL: https://codereview.chromium.org/375973002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@281927 0039d316-1c4b-4281-b951-d872f2087c98
parent 70521c9a
......@@ -394,7 +394,7 @@ class AndroidCommands(object):
'Unable to find $EXTERNAL_STORAGE')
return self._external_storage
def WaitForDevicePm(self):
def WaitForDevicePm(self, timeout=120):
"""Blocks until the device's package manager is available.
To workaround http://b/5201039, we restart the shell and retry if the
......@@ -407,7 +407,7 @@ class AndroidCommands(object):
retries = 3
while retries:
try:
self._adb.WaitForDevicePm()
self._adb.WaitForDevicePm(wait_time=timeout)
return # Success
except errors.WaitForResponseTimedOutError as e:
last_err = e
......@@ -446,7 +446,7 @@ class AndroidCommands(object):
timeout = 120
# To run tests we need at least the package manager and the sd card (or
# other external storage) to be ready.
self.WaitForDevicePm()
self.WaitForDevicePm(timeout)
self.WaitForSdCardReady(timeout)
def Shutdown(self):
......
......@@ -16,6 +16,8 @@ Local Modifications:
|longMsg| to provide more information when debugging.
3. Applied the patch file patch.diff to fix a race condition and subproccess
bugs in run_command.py.
4. Fixed a bug where wait_time wasn't properly respected in
_WaitForShellCommandContents.
Here is the detail steps
1. Checkout Android source code
......
......@@ -318,7 +318,7 @@ class AdbInterface:
respond.
"""
logger.Log("Waiting for device package manager...")
self.SendCommand("wait-for-device")
self.SendCommand("wait-for-device", timeout_time=wait_time, retry_count=0)
# Now the device is there, but may not be running.
# Query the package manager with a basic command
try:
......@@ -409,7 +409,8 @@ class AdbInterface:
while not success and (attempts*wait_period) < wait_time:
# assume the command will always contain expected in the success case
try:
output = self.SendShellCommand(command, retry_count=1)
output = self.SendShellCommand(command, retry_count=1,
timeout_time=wait_time)
if ((not invert and expected in output)
or (invert and expected not in output)):
success = True
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment