TransactionTestCase._fixture_teardown locks under mysql
|Reported by:||Jeremy Dunck||Owned by:||Aymeric Augustin|
|Cc:||btimby@…||Triage Stage:||Ready for checkin|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
When using multiple aliases to the same DB (either via TEST_MIRROR or simply different aliases with the same settings), it is possible to get 2 pending transactions because each DB alias gets its own connection to the DB.
The change in f758bdab moves DB flush to the end of the test case -- this is nice because it allows test case reordering and related optimizations.
Unfortunately, moving it to the end also means that the DB connection states aren't as clean as they were at the beginning of the testcase, so it's possible that a pending transaction on one alias blocks the progress of the flush command.