Closed Bug 1482887 Opened Last year Closed Last year

Remote automation should kill already running instances rather than dying


(Testing :: General, enhancement)

Not set


(firefox63 fixed)

Tracking Status
firefox63 --- fixed


(Reporter: bc, Assigned: bc)



(1 file)'s launch_application has an option to fail if an instance is already running which can be useful however 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]

Review of attachment 8999615 [details] [diff] [review]:

Traditionally, we stop the test app when the harness is starting. For example,

...and also, we try to make sure that the app is stopped after a test run completes:

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/
@@ +241,5 @@
>              self.stdoutlen = 0
>              self.utilityPath = None
> +            if app and self.device.process_exist(app):
> +                print(" %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
Remote automation should kill already running instances rather than dying, r=gbrown.
Closed: Last year
Resolution: --- → FIXED
Target Milestone: --- → mozilla63
You need to log in before you can comment on or make changes to this bug.