﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
16490	For select_for_update feature: DatabaseError not raised as expected when NOWAIT not supported; mult thread test also failing (on MySQL)	Jim Dalton	nobody	"The following test fails on MySQL InnoDB. This appears to relate to the work recently done on #2705.

{{{
$ ./runtests.py --settings=testproject.settings select_for_update.SelectForUpdateTests
Creating test database for alias 'default'...
Creating test database for alias 'other'...
F.s...F
======================================================================
FAIL: test_block (modeltests.select_for_update.tests.SelectForUpdateTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ""/Users/jsdalton/webs/testproject/src/django/django/test/testcases.py"", line 615, in skip_wrapper
    return test_func(*args, **kwargs)
  File ""/Users/jsdalton/webs/testproject/src/django/django/test/testcases.py"", line 615, in skip_wrapper
    return test_func(*args, **kwargs)
  File ""/Users/jsdalton/webs/testproject/src/django/tests/modeltests/select_for_update/tests.py"", line 209, in test_block
    self.assertEqual('Fred', p.name)
AssertionError: 'Fred' != u'Reinhardt'

======================================================================
FAIL: test_unsupported_nowait_raises_error (modeltests.select_for_update.tests.SelectForUpdateTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ""/Users/jsdalton/webs/testproject/src/django/django/test/testcases.py"", line 615, in skip_wrapper
    return test_func(*args, **kwargs)
  File ""/Users/jsdalton/webs/testproject/src/django/django/test/testcases.py"", line 615, in skip_wrapper
    return test_func(*args, **kwargs)
  File ""/Users/jsdalton/webs/testproject/src/django/tests/modeltests/select_for_update/tests.py"", line 138, in test_unsupported_nowait_raises_error
    Person.objects.all().select_for_update(nowait=True)
AssertionError: DatabaseError not raised

----------------------------------------------------------------------
Ran 7 tests in 10.342s

FAILED (failures=2, skipped=1)
Destroying test database for alias 'default'...
Destroying test database for alias 'other'...

}}}


The DatabaseError is not being raised because -- well, I wish I knew. The code block is being executed but the error is being caught, i.e. I can print to stdout but any exception is not being raised. The thread related error is also something I'm unclear on.

As part of the work I am doing right now on #11665, these two issues are the *only* remaining failures in the MySQL test suite. Seriously, the only remaining failures. Given that this feature seems to be quite new, I'm hopeful that it's fresh on everyone's minds and easy enough to address, perhaps by the folks who worked so hard on #2705. If I can be of any assistance, let me know."	Bug	closed	Testing framework	dev	Normal	fixed		jim.dalton@…	Ready for checkin	1	0	0	0	1	0
