#29062: "database table locked errors" when using sqlite in-memory database with
LiveServerTestCase
-------------------------------------+-------------------------------------
Reporter: Juozas Masiulis | Owner: nobody
Type: Bug | Status: new
Component: Testing framework | Version: 2.0
Severity: Normal | Resolution:
Keywords: sqlite, testing, | Triage Stage: Accepted
databases |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Chris Jerdonek):
FYI, yesterday I found and described the root cause of this issue on
#32416. (There I was interested in a different issue that affected non-
SQLite databases, though, namely database connections not being closed
when `LiveServerTestCase` is used with the new threading behavior.)
If you read my first comments on that issue, you can see that a possible
fix is to define suitable method overrides in `ThreadedWSGIServer`.
Basically the same SQLite-specific connection-sharing logic that
`LiveServerTestCase.LiveServerThread()` and `LiveServerThread.run()` have
needs to be added to `ThreadedWSGIServer`. The `LiveServerTestCase` and
`LiveServerThread` logic can be found more or less here:
https://github.com/django/django/blob/63d239db037f02d98b7771c90422840bbb4a319a/django/test/testcases.py#L1524-L1537
https://github.com/django/django/blob/63d239db037f02d98b7771c90422840bbb4a319a/django/test/testcases.py#L1465-L1469
--
Ticket URL: <https://code.djangoproject.com/ticket/29062#comment:17>
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 view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/068.9731d7568e40036234998c4bb4870cad%40djangoproject.com.