Closed Bug 640010 Opened 13 years ago Closed 13 years ago

mozrunner should be able to tell if its running

Categories

(Testing Graveyard :: Mozmill, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: k0scist, Assigned: k0scist)

References

Details

(Whiteboard: [mozmill-2.0+])

Attachments

(1 file)

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.
Whiteboard: [mozmill-2.0?]
Summary: mozrunner should be able to tell if its runnin → mozrunner should be able to tell if its running
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.
Whiteboard: [mozmill-2.0?] → [mozmill-2.0+]
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
Blocks: 584470
Blocks: 627160
Blocks: 639991
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: nobody → jhammel
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
it should be this easy assuming mozprocess is robust underneath
Attachment #544608 - Flags: review?(ctalbert)
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+
pushed to master: https://github.com/mozautomation/mozmill/commit/df9e7a59095c9688c4c6ee30a0677ea8aeb62fce
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Product: Testing → Testing Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: