cellular: Handle slow modem resume in network_MobileSuspendResume
BUG=chromium:233411
TEST=network_MobileSuspendResume
Change-Id: I6a803aee9395d4c26b818ccfba6658815fa0a49c
Reviewed-on: https://gerrit.chromium.org/gerrit/48664
Reviewed-by: Arman Uguray <armansito@chromium.org>
Commit-Queue: Thieu Le <thieule@chromium.org>
Tested-by: Thieu Le <thieule@chromium.org>
diff --git a/client/site_tests/network_MobileSuspendResume/network_MobileSuspendResume.py b/client/site_tests/network_MobileSuspendResume/network_MobileSuspendResume.py
index 3f91343..bd09864 100644
--- a/client/site_tests/network_MobileSuspendResume/network_MobileSuspendResume.py
+++ b/client/site_tests/network_MobileSuspendResume/network_MobileSuspendResume.py
@@ -108,15 +108,15 @@
# There appears to be an issue after suspend/resume where GetProperties
# returns with UnknownMethod called until some time later.
def __get_mobile_device(self, timeout=TIMEOUT):
- start_time = time.time()
- device = self.FindMobileDevice(timeout)
-
properties = None
+ start_time = time.time()
timeout = start_time + timeout
while properties is None and time.time() < timeout:
try:
+ device = self.FindMobileDevice(timeout)
properties = device.GetProperties(utf8_strings=True)
- except:
+ except dbus.exceptions.DBusException:
+ logging.debug('Mobile device not ready yet')
properties = None
time.sleep(1)