#10868: _destroy_test_db exposes the production database to possibly destructive
actions from the unit tests
-------------------------------------+-------------------------------------
     Reporter:  ovidiu               |                    Owner:  nobody
         Type:  Bug                  |                   Status:  new
    Component:  Testing framework    |                  Version:
     Severity:  Release blocker      |               Resolution:
     Keywords:  django.test          |             Triage Stage:  Design
    Has patch:  1                    |  decision needed
  Needs tests:  0                    |      Needs documentation:  0
Easy pickings:  0                    |  Patch needs improvement:  0
                                     |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by akaariai):

 * has_patch:  0 => 1


Comment:

 The attached patch solves the issue by checking threads still alive which
 have been created during testing before tearing down databases. If there
 are any, bail out.

 If it is OK to not restore fully the state of the connections, then this
 would be easier to solve by just changing the connection settings for the
 main thread (the thread doing the teardown).

 Main complaint against the above patch is IMHO backwards compatibility: if
 you knowingly let threads exists after tests have ran, you have no choice
 other than to do thread-cleanup before the teardown stage. And there is no
 hook for doing that.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/10868#comment:12>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to