mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-19 00:05:36 +00:00
Bug 1509207 - In android tests, wait for valid ro.build.version.sdk; r=bc
'getprop ro.build.version.sdk' intermittently returns '' on startup. This change tries to wait and retry until a valid response is received.
This commit is contained in:
parent
599d3ecb6b
commit
7d230281f8
@ -725,8 +725,20 @@ class ADBDevice(ADBCommand):
|
||||
|
||||
self._selinux = None
|
||||
self.enforcing = 'Permissive'
|
||||
self.version = int(self.shell_output("getprop ro.build.version.sdk",
|
||||
timeout=timeout))
|
||||
|
||||
self.version = 0
|
||||
while self.version < 1 and (time.time() - start_time) <= float(timeout):
|
||||
try:
|
||||
version = self.shell_output("getprop ro.build.version.sdk",
|
||||
timeout=timeout)
|
||||
self.version = int(version)
|
||||
except ValueError:
|
||||
self._logger.info("unexpected ro.build.version.sdk: '%s'" % version)
|
||||
time.sleep(2)
|
||||
if self.version < 1:
|
||||
# note slightly different meaning to the ADBTimeoutError here (and above):
|
||||
# failed to get valid (numeric) version string in all attempts in allowed time
|
||||
raise ADBTimeoutError("ADBDevice: unable to determine ro.build.version.sdk.")
|
||||
|
||||
# Do we have pidof?
|
||||
if self.version >= version_codes.N:
|
||||
|
Loading…
Reference in New Issue
Block a user