mapnik-org/mapnik — Issue #432: Idle postgres connection interferes with some automated testing frameworks
Author: artemp
Created: 2011-10-11 07:55:22+00:00
State: open
Labels: PostGIS_Input_Driver

Using django testing framework, some unit tests were written that generate a basic default map which draws from postgis.

The db connection stays open (due to connection pooling?). While this is good behavior in production, the testing framework creates a test db, runs tests then destroys the test db as the final step. Because mapnik still has an idle postgres connection, the test script throws an exception:

psycopg2.OperationalError: database "test_simple1" is being accessed by other users
DETAIL: There are 1 other session(s) using the database.

It would be nice to have a way to control this connection behavior via the mapnik API.