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.
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.
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
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
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
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
Comment on attachment 544608 [details] [diff] [review] use the process handler as a start/stop marker r+ simple and easy.
pushed to master: https://github.com/mozautomation/mozmill/commit/df9e7a59095c9688c4c6ee30a0677ea8aeb62fce