Changes between Initial Version and Version 1 of Ticket #18984, comment 5
- Timestamp:
- Nov 20, 2012, 3:13:21 PM (12 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #18984, comment 5
initial v1 1 I 'm attaching a test case that triggers the deadlock. You need an appropriate DATABASES setting — see the comments in thepatch.1 In fact, when `TEST_MIRROR is set`, even an empty test triggers the deadlock! See attached patch. 2 2 3 3 Running the test with MySQL deadlocks. It dies after the third Ctrl-C with the trace below. This is reproducible. … … 7 7 Creating test database for alias 'default'... 8 8 Creating test database for alias 'other'... 9 E^C^C^CE 10 ====================================================================== 11 ERROR: test_teardown_deadlock (regressiontests.test_runner.tests.MirrorDeadlockTest) 12 ---------------------------------------------------------------------- 13 Traceback (most recent call last): 14 File "/Users/myk/Documents/dev/django/tests/regressiontests/test_runner/tests.py", line 298, in test_teardown_deadlock 15 Person.objects.using('default').create(first_name='Adrian', last_name='Holovaty') 16 File "/Users/myk/Documents/dev/django/django/db/transaction.py", line 202, in __exit__ 17 self.exiting(exc_value, self.using) 18 File "/Users/myk/Documents/dev/django/django/db/transaction.py", line 287, in exiting 19 leave_transaction_management(using=using) 20 File "/Users/myk/Documents/dev/django/django/db/transaction.py", line 51, in leave_transaction_management 21 connection.leave_transaction_management() 22 File "/Users/myk/Documents/dev/django/django/db/backends/__init__.py", line 126, in leave_transaction_management 23 "Transaction managed block ended with pending COMMIT/ROLLBACK") 24 TransactionManagementError: Transaction managed block ended with pending COMMIT/ROLLBACK 25 9 You're going to deadlock, human. MUHAHA. 10 .^C^C^CE 26 11 ====================================================================== 27 12 ERROR: test_teardown_deadlock (regressiontests.test_runner.tests.MirrorDeadlockTest) … … 32 17 File "/Users/myk/Documents/dev/django/django/test/testcases.py", line 492, in _post_teardown 33 18 self._fixture_teardown() 34 File "/Users/myk/Documents/dev/django/django/test/testcases.py", line 51 0, in _fixture_teardown19 File "/Users/myk/Documents/dev/django/django/test/testcases.py", line 517, in _fixture_teardown 35 20 skip_validation=True, reset_sequences=False) 36 21 File "/Users/myk/Documents/dev/django/django/core/management/__init__.py", line 160, in call_command … … 53 38 54 39 ---------------------------------------------------------------------- 55 Ran 1 test in 156.871s40 Ran 1 test in 3.969s 56 41 57 FAILED (errors= 2)42 FAILED (errors=1) 58 43 Destroying test database for alias 'default'... 59 44 Destroying test database for alias 'other'...