mozrunner should be able to tell if its running

RESOLVED FIXED

Status

Testing Graveyard
Mozmill
RESOLVED FIXED
7 years ago
a year ago

People

(Reporter: Jeff Hammel, Assigned: Jeff Hammel)

Tracking

Details

(Whiteboard: [mozmill-2.0+])

Attachments

(1 attachment)

(Assignee)

Description

7 years ago
Currently, there is no way to look at a runner object and see if its
actually running.  This makes stop_runner fairly unreliable.  You stop
the runner during the test.  Are you actually stopped?  Do you need to
kill it?  You're not sure!  You should be able to get this information
from the runner.
(Assignee)

Updated

7 years ago
Whiteboard: [mozmill-2.0?]
(Assignee)

Updated

7 years ago
Summary: mozrunner should be able to tell if its runnin → mozrunner should be able to tell if its running

Comment 1

7 years ago
This is exactly what bug 640047 is all about for windows.  While doing that for windows I'll see about doing that for the other platforms too.

Updated

7 years ago
Whiteboard: [mozmill-2.0?] → [mozmill-2.0+]
(Assignee)

Comment 2

7 years ago
It shouldn't be hard to do for posix, just have to be careful we're doing what we think we're doing.  Without this, something like bug 638989 can keep track of whether the browser needs to be restarted or not at the mozmill-level, but if something goes wrong (e.g. you hit a race condition, or the browser doesnt shut down for some reason) it will hang/kill the harness.  

For posix you can achieve this by seeing if the PID is running and is tied to the correct process.  In any case, a method like Runner.is_running() would be very nice
(Assignee)

Updated

7 years ago
Blocks: 584470
(Assignee)

Updated

7 years ago
Blocks: 627160
(Assignee)

Updated

7 years ago
Blocks: 639991
(Assignee)

Comment 3

7 years ago
I can stub this out, but bug 668637 makes me really nervous here.  We should be really sure our story is solid wrt stopping.  If we can robustly stop, this is probably easy.  If we can't, this is effectively impossible
(Assignee)

Updated

7 years ago
Assignee: nobody → jhammel
(Assignee)

Comment 4

7 years ago
so if everything else is robust, we should be able to have a very simple isRunning method:

def isRunning(self):
   return self.processHandler is not None

then if we set self.processHandler to None when we're stopped, we're pretty much done.

https://github.com/mozautomation/mozmill/blob/master/mozrunner/mozrunner/runner.py#L240 

This relies on everything else working properly in mozprocess, but that's the point of the package anyway
(Assignee)

Comment 5

7 years ago
Created attachment 544608 [details] [diff] [review]
use the process handler as a start/stop marker

it should be this easy assuming mozprocess is robust underneath
Attachment #544608 - Flags: review?(ctalbert)

Comment 6

7 years ago
Comment on attachment 544608 [details] [diff] [review]
use the process handler as a start/stop marker

r+ simple and easy.
Attachment #544608 - Flags: review?(ctalbert) → review+
(Assignee)

Comment 7

7 years ago
pushed to master: https://github.com/mozautomation/mozmill/commit/df9e7a59095c9688c4c6ee30a0677ea8aeb62fce
Status: NEW → RESOLVED
Last Resolved: 7 years ago
Resolution: --- → FIXED
Product: Testing → Testing Graveyard
You need to log in before you can comment on or make changes to this bug.