![]() ![]() This is tests % PYTHONPATH=./runtests.py -settings=test_mysql_local test_runner.MirrorDeadlockTest ~/Documents/dev/django/testsĬreating test database for alias 'default'.Ĭreating test database for alias 'other'.ĮRROR: test_teardown_deadlock (regressiontests.test_)įile "/Users/myk/Documents/dev/django/django/test/testcases.py", line 478, in _call_įile "/Users/myk/Documents/dev/django/django/test/testcases.py", line 492, in _post_teardownįile "/Users/myk/Documents/dev/django/django/test/testcases.py", line 517, in _fixture_teardown It dies after the third Ctrl-C with the trace below. In fact, when TEST_MIRROR is set, even an empty test triggers the deadlock! See attached patch. If you can confirm that I understood the problem correctly, I will reproduce it manually and commit your fix. Therefore, I think this falls under "the test runner can't test itself." If Django had a regression, the test runner would then hang in teardown, without any hint as to what's happening. I considered adding a test that triggers the bug to the test suite. Since the fix is quite simple I agree with you. That would mean putting try / finally clauses everywhere - not nice. The alternative would be to document that transaction test cases must not leave pending transactions behind themselves. The more general problem is "should Django's test runner protect users against tests that leave pending transactions?". Then _fixture_teardown will attempt to flush that table using the first connection, triggering a lock on the write with the second connection. with each connection, open a transaction and makes a write (actually, if I check the order of connection, I can only do this on the second one).create a multi-db transaction test case.create two aliases pointing to the same database.If I understand correctly, this only happens with and when multi_db = True (with tests are wrapped in a transaction that is rolled back at the end of the test).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |