#34930: Parallel tests fail on Python 3.11+ and MacOS.
-------------------------------------+-------------------------------------
     Reporter:  Matt Hegarty         |                    Owner:  nobody
         Type:  Bug                  |                   Status:  closed
    Component:  Testing framework    |                  Version:  4.2
     Severity:  Normal               |               Resolution:  needsinfo
     Keywords:  pickle               |             Triage Stage:
  _contextvars.Context _contextvars  |  Unreviewed
  Context                            |
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by Natalia Bidart):

 * status:  new => closed
 * resolution:   => needsinfo


Comment:

 I can confirm I also get the reported error with the given reproducer,
 running on a Manjaro system (amd64):

 {{{
 Traceback (most recent call last):
   File "/home/nessita/fellowship/django/tests/runtests.py", line 783, in
 <module>
     failures = django_tests(
                ^^^^^^^^^^^^^
   File "/home/nessita/fellowship/django/tests/runtests.py", line 421, in
 django_tests
     failures = test_runner.run_tests(test_labels)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   File "/home/nessita/fellowship/django/django/test/runner.py", line 1068,
 in run_tests
     result = self.run_suite(suite)
              ^^^^^^^^^^^^^^^^^^^^^
   File "/home/nessita/fellowship/django/django/test/runner.py", line 995,
 in run_suite
     return runner.run(suite)
            ^^^^^^^^^^^^^^^^^
   File "/usr/lib/python3.11/unittest/runner.py", line 217, in run
     test(result)
   File "/usr/lib/python3.11/unittest/suite.py", line 84, in __call__
     return self.run(*args, **kwds)
            ^^^^^^^^^^^^^^^^^^^^^^^
   File "/home/nessita/fellowship/django/django/test/runner.py", line 541,
 in run
     subsuite_index, events = test_results.next(timeout=0.1)
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   File "/usr/lib/python3.11/multiprocessing/pool.py", line 873, in next
     raise value
   File "/usr/lib/python3.11/multiprocessing/pool.py", line 540, in
 _handle_tasks
     put(task)
   File "/usr/lib/python3.11/multiprocessing/connection.py", line 205, in
 send
     self._send_bytes(_ForkingPickler.dumps(obj))
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
   File "/usr/lib/python3.11/multiprocessing/reduction.py", line 51, in
 dumps
     cls(buf, protocol).dump(obj)
 TypeError: cannot pickle '_contextvars.Context' object
 Exception ignored in: <function Pool.__del__ at 0x7f16d6958680>
 Traceback (most recent call last):
   File "/usr/lib/python3.11/multiprocessing/pool.py", line 268, in __del__
 ResourceWarning: unclosed running multiprocessing pool
 <multiprocessing.pool.Pool state=RUN pool_size=4>
 }}}

 What I don't have clarity is whether this ever worked, I have bisected up
 to the adding of ASGI support (commit
 `a415ce70bef6d91036b00dd2c8544aed7aeeaaed`) and the given tests are still
 failing. I have also checked out `stable/4.0.x` and the tests are still
 not working.

 Matt, can you please explain how Django is at fault here? It seems that
 `IsolatedAsyncioTestCase` hasn't been (ever?) supported?

-- 
Ticket URL: <https://code.djangoproject.com/ticket/34930#comment:4>
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 on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018b6edced59-e5469bc0-4708-4946-9e21-eb503ad9534e-000000%40eu-central-1.amazonses.com.

Reply via email to