#36596: django_test_expected_failures has no effect on the parallel test runner 
in
"spawn" mode
-------------------------------------+-------------------------------------
     Reporter:  Jacob Walls          |                     Type:  Bug
       Status:  new                  |                Component:  Testing
                                     |  framework
      Version:  dev                  |                 Severity:  Normal
     Keywords:  multiprocessing      |             Triage Stage:
                                     |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
 The [https://docs.djangoproject.com/en/5.2/releases/3.2/#database-backends
 django_test_expected_failures] method has no effect on the parallel test
 runner in "spawn" multiprocessing mode, because it uses `setattr` to
 
[https://github.com/django/django/blob/4e7a991c12a113229e0927974d3bf94ea04eecf6/django/db/backends/base/creation.py#L365
 monkey-patch] a class, and that patching is lost when workers are spawned.

 To reproduce:
 - add `multiprocessing.set_start_method("spawn")` near the top of
 runtests.py if not running on MacOS or Windows
 - adjust postgres database settings to include `"OPTIONS": {
 "server_side_binding": True}` (to trigger an expected failure),
 - `./runtests.py aggregation.tests --settings=test_postgres --parallel=1`
 : passes
 - `./runtests.py aggregation.tests --settings=test_postgres`: fails

 Python will be defaulting all systems into "spawn" by default in Python
 3.14, so we're about to see more traffic into this.
-- 
Ticket URL: <https://code.djangoproject.com/ticket/36596>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/django-updates/01070199165c2504-92f871a2-a3f9-4259-87e1-ca74258d8920-000000%40eu-central-1.amazonses.com.

Reply via email to