karenc / db-migrator

GNU Affero General Public License v3.0
4 stars 5 forks source link

create a savepoint around should_run - rollback on false, to restore … #47

Closed reedstrm closed 7 years ago

reedstrm commented 7 years ago

…db state Observed when running migration tests, that if should_run touches the database (even just reading, and even returning nothing), and subsequent migrations use the super_user cursor, they stall waiting on an "idle in transaction" connection that ran the should_run test code. For some reason, this only happens when running under python3.

Adding this savepoint/rollback to pair fixes the observed problem.

Further thought/discussion about the role of transactions and dbmigrator migrations is probably needed.

coveralls commented 7 years ago

Coverage Status

Coverage increased (+0.008%) to 97.126% when pulling 74148087adf981ae67bf39778a130645cfb90872 on Connexions:should-run-rollback into 78a3d3f13ffd5dc9aa41b8481a2d477d603f71ea on karenc:master.

karenc commented 7 years ago

I tried to write a test for this but couldn't seem to trigger the same problem as cnx-db. :/