#33891 closed Bug (fixed)
TypeError when trying to run tests in parallel with spawn.
Reported by: | Kevin Renskers | Owned by: | Mariusz Felisiak |
---|---|---|---|
Component: | Testing framework | Version: | 4.1 |
Severity: | Release blocker | Keywords: | |
Cc: | Carlton Gibson | Triage Stage: | Accepted |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
After updating to Django 4.1 I can no longer run my tests in parallel. I get seemingly endless errors in my terminal.
(env) $ ./manage.py test --parallel Found 124 test(s). Creating test database for alias 'default'... Cloning test database for alias 'default'... Cloning test database for alias 'default'... Cloning test database for alias 'default'... Cloning test database for alias 'default'... Cloning test database for alias 'default'... Cloning test database for alias 'default'... Cloning test database for alias 'default'... Cloning test database for alias 'default'... Cloning test database for alias 'default'... Cloning test database for alias 'default'... System check identified no issues (0 silenced). Process SpawnPoolWorker-7: Process SpawnPoolWorker-2: Process SpawnPoolWorker-6: Process SpawnPoolWorker-3: Process SpawnPoolWorker-1: Process SpawnPoolWorker-8: Process SpawnPoolWorker-5: Traceback (most recent call last): Traceback (most recent call last): Traceback (most recent call last): Traceback (most recent call last): Traceback (most recent call last): Traceback (most recent call last): File "/opt/homebrew/Cellar/python@3.10/3.10.5/Frameworks/Python.framework/Versions/3.10/lib/python3.10/multiprocessing/process.py", line 315, in _bootstrap self.run() File "/opt/homebrew/Cellar/python@3.10/3.10.5/Frameworks/Python.framework/Versions/3.10/lib/python3.10/multiprocessing/process.py", line 108, in run self._target(*self._args, **self._kwargs) File "/opt/homebrew/Cellar/python@3.10/3.10.5/Frameworks/Python.framework/Versions/3.10/lib/python3.10/multiprocessing/pool.py", line 109, in worker initializer(*initargs) File "/opt/homebrew/Cellar/python@3.10/3.10.5/Frameworks/Python.framework/Versions/3.10/lib/python3.10/multiprocessing/process.py", line 315, in _bootstrap self.run() File "/Users/kevin/Workspace/cn-django/env/lib/python3.10/site-packages/django/test/runner.py", line 420, in _init_worker process_setup(*process_setup_args) File "/opt/homebrew/Cellar/python@3.10/3.10.5/Frameworks/Python.framework/Versions/3.10/lib/python3.10/multiprocessing/process.py", line 108, in run self._target(*self._args, **self._kwargs) File "/opt/homebrew/Cellar/python@3.10/3.10.5/Frameworks/Python.framework/Versions/3.10/lib/python3.10/multiprocessing/pool.py", line 109, in worker initializer(*initargs) File "/opt/homebrew/Cellar/python@3.10/3.10.5/Frameworks/Python.framework/Versions/3.10/lib/python3.10/multiprocessing/process.py", line 315, in _bootstrap self.run() File "/opt/homebrew/Cellar/python@3.10/3.10.5/Frameworks/Python.framework/Versions/3.10/lib/python3.10/multiprocessing/process.py", line 315, in _bootstrap self.run() File "/Users/kevin/Workspace/cn-django/env/lib/python3.10/site-packages/django/test/runner.py", line 420, in _init_worker process_setup(*process_setup_args) Traceback (most recent call last): TypeError: ParallelTestSuite.process_setup() missing 1 required positional argument: 'self'
That traceback and error then keeps repeating.
If I run the tests just with ./manage.py test
, everything works fine.
Change History (4)
comment:1 by , 2 years ago
Cc: | added |
---|---|
Owner: | changed from | to
Severity: | Normal → Release blocker |
Status: | new → assigned |
Summary: | TypeError when trying to run tests in parallel → TypeError when trying to run tests in parallel with spawn. |
Triage Stage: | Unreviewed → Accepted |
Note:
See TracTickets
for help on using tickets.
It looks that I overcomplicated 41c4cb253c137edf5a96b7408ea55d57d6e0602a, sorry. Does the following patch work for you?
django/test/runner.py
def process_setup(self, *args):"""Stub method to simplify run() implementation. "self" is never actuallypassed because a function implementing this method (__func__) isalways used, not the method itself."""pass