Opened 3 years ago
Closed 3 years ago
#33627 closed Cleanup/optimization (fixed)
model_forms.tests.ModelMultipleChoiceFieldTests.test_model_multiple_choice_field fails when running together with other cases
Reported by: | Xiang Zhang | Owned by: | Sander Beekhuis |
---|---|---|---|
Component: | Testing framework | Version: | 4.0 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Ready for checkin | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | yes | UI/UX: | no |
Description
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)
comment:1 by , 3 years ago
comment:2 by , 3 years ago
Has patch: | set |
---|
comment:3 by , 3 years ago
Triage Stage: | Unreviewed → Ready for checkin |
---|
comment:4 by , 3 years ago
Component: | Uncategorized → Testing framework |
---|---|
Triage Stage: | Ready for checkin → Accepted |
Type: | Uncategorized → Cleanup/optimization |
Thanks, but please do not mark your own patches as Ready for checkin. Only a reviewer should.
comment:5 by , 3 years ago
Owner: | changed from | to
---|---|
Patch needs improvement: | set |
Status: | new → assigned |
comment:6 by , 3 years ago
Patch needs improvement: | unset |
---|---|
Triage Stage: | Accepted → Ready for checkin |
Note:
See TracTickets
for help on using tickets.
An attempt to resolve this ticket has been done in https://github.com/django/django/pull/15570