Closed Bug 1482887 Opened Last year Closed Last year
Remote automation should kill already running instances rather than dying
adb_android.py's launch_application has an option to fail if an instance is already running which can be useful however remoteautomation.py does not attempt to recover the situation. I think we should have RProcess kill any running instance prior to attempting to launch.
try coming soon.
Attachment #8999615 - Flags: review?(gbrown)
Comment on attachment 8999615 [details] [diff] [review] RProcess-stop-application.patch Review of attachment 8999615 [details] [diff] [review]: ----------------------------------------------------------------- Traditionally, we stop the test app when the harness is starting. For example, https://dxr.mozilla.org/mozilla-central/rev/4e56a2f51ad739ca52046723448f3129a58f1666/testing/mochitest/runtestsremote.py#95 ...and also, we try to make sure that the app is stopped after a test run completes: https://dxr.mozilla.org/mozilla-central/rev/4e56a2f51ad739ca52046723448f3129a58f1666/build/mobile/remoteautomation.py#90-92 But I think there are some holes in that logic: Like on a mochitest run with multiple browser sessions, if the browser goes to the background, if get_top_activity fails, etc. So, I like this! ::: build/mobile/remoteautomation.py @@ +241,5 @@ > self.stdoutlen = 0 > self.utilityPath = None > > + if app and self.device.process_exist(app): > + print("remoteautomation.py %s is already running. Stopping...") If we could do without this message, I think we could avoid the process_exist() call -- it looks like calling stop_application is okay whether the process is running or not. But the message might be useful -- alert us to unexpected behavior, etc. -- so probably best to keep it as it is.
Attachment #8999615 - Flags: review?(gbrown) → review+
Thanks. I ran into this a bunch this weekend trying to get mach working for android hardware testing. Maybe we can chase it down.
Pushed by email@example.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/3f7bfeff4b2f Remote automation should kill already running instances rather than dying, r=gbrown.
You need to log in before you can comment on or make changes to this bug.