Changes between Initial Version and Version 1 of Ticket #18984, comment 5


Ignore:
Timestamp:
Nov 20, 2012, 3:13:21 PM (12 years ago)
Author:
Aymeric Augustin

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 the patch.
     1In fact, when `TEST_MIRROR is set`, even an empty test triggers the deadlock! See attached patch.
    22
    33Running the test with MySQL deadlocks. It dies after the third Ctrl-C with the trace below. This is reproducible.
     
    77Creating test database for alias 'default'...
    88Creating 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 
     9You're going to deadlock, human. MUHAHA.
     10.^C^C^CE
    2611======================================================================
    2712ERROR: test_teardown_deadlock (regressiontests.test_runner.tests.MirrorDeadlockTest)
     
    3217  File "/Users/myk/Documents/dev/django/django/test/testcases.py", line 492, in _post_teardown
    3318    self._fixture_teardown()
    34   File "/Users/myk/Documents/dev/django/django/test/testcases.py", line 510, in _fixture_teardown
     19  File "/Users/myk/Documents/dev/django/django/test/testcases.py", line 517, in _fixture_teardown
    3520    skip_validation=True, reset_sequences=False)
    3621  File "/Users/myk/Documents/dev/django/django/core/management/__init__.py", line 160, in call_command
     
    5338
    5439----------------------------------------------------------------------
    55 Ran 1 test in 156.871s
     40Ran 1 test in 3.969s
    5641
    57 FAILED (errors=2)
     42FAILED (errors=1)
    5843Destroying test database for alias 'default'...
    5944Destroying test database for alias 'other'...
Back to Top