model_forms.tests.ModelMultipleChoiceFieldTests.test_model_multiple_choice_field fails when running together with other cases
When running python3 runtests.py model_forms
case model_forms.tests.ModelMultipleChoiceFieldTests.test_model_multiple_choice_field
might fail:
python3 runtests.py model_forms --noinput --settings tidb_settings
Testing against Django installed in '/home/runner/work/django-tidb/django-tidb/django_tests_dir/django/django' with up to 2 processes
Found 177 test(s).
Creating test database for alias 'default'...
System check identified no issues (0 silenced).
...............................................................................................................F.................................................................
======================================================================
FAIL: test_model_multiple_choice_field (model_forms.tests.ModelMultipleChoiceFieldTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/runner/work/django-tidb/django-tidb/django_tests_dir/django/tests/model_forms/tests.py", line 2088, in test_model_multiple_choice_field
with self.assertRaises(ValidationError):
AssertionError: ValidationError not raised
Running it solely could succeed consistently. After some ingestion, I found the reason is the id
field of model_forms_category
is auto_increment
. If you run the suite together, it might hit 100
by accident and then fail.
Change History (7)
Triage Stage: |
Unreviewed →
Ready for checkin
|
Component: |
Uncategorized →
Testing framework
|
Triage Stage: |
Ready for checkin →
Accepted
|
Type: |
Uncategorized →
Cleanup/optimization
|
Owner: |
changed from nobody to Sander Beekhuis
|
Patch needs improvement: |
set
|
Status: |
new →
assigned
|
Patch needs improvement: |
unset
|
Triage Stage: |
Accepted →
Ready for checkin
|
Resolution: |
→ fixed
|
Status: |
assigned →
closed
|
An attempt to resolve this ticket has been done in https://github.com/django/django/pull/15570