awesomo/django-ztaskq — pull request #6 by msabramo (2012-05-07 15:46:51+00:00)
Title: Tests

This is my attempt at writing a test for `django-taskq`.

It's tricky because there are a lot of processes that need to coordinate with each other and that need to be properly terminated in order to avoid leaving around zombie processes.

The test forks a child that spawns the ztaskd, workerd, and runserver and runs the actual test, which involves reading the output of the workerd. The reason that the test forks a child for this and doesn't spawn those on its own is so that we can set the process group id of all of them to the pid of the child and then at the end, do `killpg` on that process group id and kill all the children without killing the process that is running the test suite.