windmill / windmill

Windmill is a web testing tool designed to let you painlessly automate and debug your web application.
https://github.com/windmill/windmill
Apache License 2.0
278 stars 48 forks source link

Windmill kills non-child firefox processes #64

Open nixon opened 13 years ago

nixon commented 13 years ago

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.

windmill commented 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.

nixon commented 13 years ago

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).

admc commented 13 years ago

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.