Bug 1190464 - Ensure emulator is killed at end of Android test; r=kmoir

This commit is contained in:
Geoff Brown 2015-08-14 09:53:13 -06:00
parent 9d783fde39
commit 2023b51ad4

View File

@ -413,10 +413,6 @@ class AndroidEmulatorTest(BlobUploadMixin, TestingMixin, EmulatorMixin, VCSMixin
except OSError, err:
self.warning("Failed to take screenshot: %s" % err.strerror)
@PostScriptRun
def _post_script(self):
self._kill_processes(self.config["emulator_process_name"])
def _query_package_name(self):
if self.app_name is None:
#find appname from package-name.txt - assumes download-and-extract has completed successfully
@ -697,6 +693,15 @@ class AndroidEmulatorTest(BlobUploadMixin, TestingMixin, EmulatorMixin, VCSMixin
self._verify_emulator()
self._kill_processes(self.config["emulator_process_name"])
def upload_blobber_files(self):
'''
Override BlobUploadMixin.upload_blobber_files to ensure emulator is killed
first (if the emulator is still running, logcat may still be running, which
may lock the blob upload directory, causing a hang).
'''
self._kill_processes(self.config["emulator_process_name"])
super(AndroidEmulatorTest, self).upload_blobber_files()
if __name__ == '__main__':
emulatorTest = AndroidEmulatorTest()
emulatorTest.run_and_exit()