LiveServerTestCase with ATOMIC_REQUESTS leaves Postgres connections open after socket error
|Reported by:||Garron Moore||Owned by:||nobody|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
When using LiveServerTestCase with ATOMIC_REQUESTS, a socket error happening in LiveServerThread can result in Postgres connections being left open. This results in the removal of the test database failing due to those open connections.
I've attached a sample test which exhibits this issue (when using postgres and ATOMIC_REQUESTS). In order for the test to exhibit the issue, there must be a view behind the targeted url.
I've also attached a patch to LiveServerThread that fixes this for me.