#22420: Postgresql connections not being dropped between tests?
-----------------------------------+--------------------------------------
     Reporter:  Matthew Fisher     |                    Owner:  nobody
         Type:  Bug                |                   Status:  closed
    Component:  Testing framework  |                  Version:  1.6
     Severity:  Normal             |               Resolution:  needsinfo
     Keywords:                     |             Triage Stage:  Unreviewed
    Has patch:  0                  |      Needs documentation:  0
  Needs tests:  0                  |  Patch needs improvement:  0
Easy pickings:  0                  |                    UI/UX:  0
-----------------------------------+--------------------------------------

Comment (by Paul Bormans):

 I'm seeing the same issue running a test suite that contains
 "TransactionTestCase" cases. Further more i'm running django 1.9.10 and
 postgres 9.3.

 The odd thing is that the testcase causing the trouble ran fine before
 using default TestCase base class. But for reasons unknown to me (maybe
 upgrade some libs?) a worker thread part of the testcase started to yield
 no results from the orm that should be initialized using fixtures. It ran
 fine again after a switched to TransactionTestCase but that gave the
 mentioned issue:

 django.db.utils.OperationalError: database "<name>" is being accessed by
 other users
 DETAIL:  There is 1 other session using the database.

 I tried the cleanup decorator and it does close 1 connection but the error
 message remains.

 I double checked that each of the Thread instances is properly closed
 (there is an explicit join() before the testcase ends).

 Does each thread have its own session? Could i explicitly close it in a
 finally block?

 Paul

--
Ticket URL: <https://code.djangoproject.com/ticket/22420#comment:19>
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 unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/070.fd74e0ccf26b7a6fee23e300e47695b3%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to