django/django — pull request #893 by dlamotte (2013-03-10 23:33:19+00:00)
Title: Ticket 18855: persist socket across runserver reloads

See discussion of this ticket on the bug tracker.

Creating a new pull request as advised in the ticket after adding documentation of the feature.

The testing part of this ticket is especially tricky. The only way I see to test the actual functionality would be to fork a new process and run "runserver" within the process (if you have other ideas, I'd love to hear them) and then interact with the new process via the opened port. Then there is the case of the race condition that this effectively tries to solve.

Given the wide use of runserver, I think that it's relatively safe to not add tests (given the difficultly of doing so). If you have any ideas on how to make this test-able, I'd definitely take suggestions and attempt to add tests for them.