Bug 1137320 - Improve wait for android emulator startup; r=kmoir
--- a/scripts/android_emulator_unittest.py
+++ b/scripts/android_emulator_unittest.py
@@ -694,16 +694,30 @@ class AndroidEmulatorTest(BlobUploadMixi
'device_package_name': self._query_package_name()
}
config = dict(config.items() + self.config.items())
self.info("Creating ADBDevicHandler for %s with config %s" % (emulator["name"], config))
dh = ADBDeviceHandler(config=config, log_obj=self.log_obj, script_obj=self)
dh.device_id = emulator['device_id']
+ # Wait for Android to finish booting
+ completed = None
+ retries = 0
+ while retries < 30:
+ completed = self.get_output_from_command([self.adb_path,
+ "-s", emulator['device_id'], "shell",
+ "getprop", "sys.boot_completed"])
+ if completed == '1':
+ break
+ time.sleep(10)
+ retries = retries + 1
+ if completed != '1':
+ self.warning('Retries exhausted waiting for Android boot.')
+
# Install Fennec
self.info("Installing Fennec for %s" % emulator["name"])
dh.install_app(self.installer_path)
# Install the robocop apk if required
if suite_name.startswith('robocop'):
self.info("Installing Robocop for %s" % emulator["name"])
config['device_package_name'] = self.config["robocop_package_name"]