Open nixon opened 13 years ago
If you know of a better way to do this I would really love a patch, its a hard problem to solve because when killing the first firefox process you also take down any others.
Is get_pids() really necessary? Why not just kill(self.pid)? If the browser process creates child processes of its own, then maybe something like:
http://code.activestate.com/recipes/576387-unix-subprocess-wrapper/
can be used to setpgrp() in the child. By having the child be its own process group, it should be possible to kill any browser children with killpg(self.pid).
This will be fixed with FF 4 as they do this a less terrible way. But for now, any improvements to this code would be great.
When using ctrl-c to terminate a windmill testcase, all firefox processes owned by the user are killed instead of just ones spawned by the windmill testcase. The problem seems to be windmill/dep/_mozrunner/runner.py:get_pids(). It runs 'ps ax' and kills any process that contains the browser string.