diff options
author | Tony Locke <tlocke@tlocke.org.uk> | 2014-07-26 20:10:36 +0100 |
---|---|---|
committer | Tony Locke <tlocke@tlocke.org.uk> | 2014-08-02 15:29:36 +0100 |
commit | ed1bbbed272d6413561a2b5a29873f1021890c0d (patch) | |
tree | f7b359455b1d4a0a9597a23f211e19669c6851d5 | |
parent | 2e44749b76af4e9e1a2fd6e52dd329dc1e980216 (diff) | |
download | sqlalchemy-ed1bbbed272d6413561a2b5a29873f1021890c0d.tar.gz |
two_phase_recover, COMMIT PREPARED in transaction
In test/engine/test_transaction/test_two_phase_recover(), a COMMIT
PREPARED is issued while in a transaction. This causes an error, and
a prepared transaction is left hanging around which causes
the subsequent test to hang. I've altered the test to execute the
offending query with autocommit=true, then when it gets to the COMMIT
PRPARED it can go ahead.
There's another complication for pg8000 because its tpc_recover() method
started a transaction if one wasn't already in progress. I've decided
that this is incorrect behaviour and so from pg8000-1.9.13 this method
never starts or stops a transaction.
-rw-r--r-- | test/engine/test_transaction.py | 7 | ||||
-rw-r--r-- | test/requirements.py | 1 |
2 files changed, 4 insertions, 4 deletions
diff --git a/test/engine/test_transaction.py b/test/engine/test_transaction.py index f9744444d..8a5303642 100644 --- a/test/engine/test_transaction.py +++ b/test/engine/test_transaction.py @@ -347,9 +347,10 @@ class TransactionTest(fixtures.TestBase): connection.invalidate() connection2 = testing.db.connect() - eq_(connection2.execute(select([users.c.user_id]). - order_by(users.c.user_id)).fetchall(), - []) + eq_( + connection2.execution_options(autocommit=True). + execute(select([users.c.user_id]). + order_by(users.c.user_id)).fetchall(), []) recoverables = connection2.recover_twophase() assert transaction.xid in recoverables connection2.commit_prepared(transaction.xid, recover=True) diff --git a/test/requirements.py b/test/requirements.py index bf9b8f526..7eeabef2b 100644 --- a/test/requirements.py +++ b/test/requirements.py @@ -363,7 +363,6 @@ class DefaultRequirements(SuiteRequirements): 'need separate XA implementation'), exclude('mysql', '<', (5, 0, 3), 'two-phase xact not supported by database'), - no_support("postgresql+pg8000", "not supported and/or hangs") ]) @property |