Two things:
1. Feedback on how best to handle this. It is my opinion that the best way
to handle this is to the child process finish itself up however long that
might take and then eventually exit. If there is some sort of bug in the
code (users' or Django's) that prevents this from the child process from
completing then the bug should be fixed. Another way to handle this would
be to timeout the p.wait in the exception with some configurable delay and
then kill and wait.
2. How should this be tested. I'm guessing that the best way to do this
would be to create a very simple command, create a subprocess that calls
that command, wait for the grand-child process to startup, send the child
process an interrupt and wait for the grand-child process to complete. It
appears that the current code avoids creating any child processes. Is
there a wish not to create child processes in the tests, or would it be ok
to do so as long as it completes quickly (i.e. don't use runserver, create
a dummy command that will run much faster).
--
Ticket URL: <https://code.djangoproject.com/ticket/29044>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* needs_tests: 0 => 1
Comment:
Setting needs tests flag. As I mentioned above, I need some feedback on
what the proper way of testing this would be.
--
Ticket URL: <https://code.djangoproject.com/ticket/29044#comment:1>
* status: new => closed
* resolution: => wontfix
Comment:
We are trying to change completely the development webserver autoreloader.
See #27685 and the related [https://github.com/django/django/pull/8819
PR], so I suspect no further features will be added to the current code.
We are finding the same problem there as you: How to test this code in
presence uf multiple processes, timing constraints, etc.? If you can
contribute somehow to that effort e.g. by testing your use case and with
ideas/code about how to implement the tests it will be greatly
appreciated.
--
Ticket URL: <https://code.djangoproject.com/ticket/29044#comment:2>