[Django] #33719: Running tests in parallel throws exceptions in Django 4.1a1

22 views
Skip to first unread message

Django

unread,
May 18, 2022, 4:05:24 AM5/18/22
to django-...@googlegroups.com
#33719: Running tests in parallel throws exceptions in Django 4.1a1
---------------------------------------------+------------------------
Reporter: Pēteris Caune | Owner: nobody
Type: Uncategorized | Status: new
Component: Testing framework | Version: 4.1
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
---------------------------------------------+------------------------
When I run `manage.py test --parallel`, I get:

{{{
Process ForkPoolWorker-387:
Traceback (most recent call last):
File "/usr/lib/python3.10/multiprocessing/process.py", line 315, in
_bootstrap
self.run()
File "/usr/lib/python3.10/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "/usr/lib/python3.10/multiprocessing/pool.py", line 109, in worker
initializer(*initargs)
File "/tmp/venv/lib/python3.10/site-packages/django/test/runner.py",
line 415, in _init_worker
with counter.get_lock():
AttributeError: 'ParallelTestSuite' object has no attribute 'get_lock'
Process ForkPoolWorker-388:
Traceback (most recent call last):
File "/usr/lib/python3.10/multiprocessing/process.py", line 315, in
_bootstrap
self.run()
File "/usr/lib/python3.10/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "/usr/lib/python3.10/multiprocessing/pool.py", line 109, in worker
initializer(*initargs)
File "/tmp/venv/lib/python3.10/site-packages/django/test/runner.py",
line 415, in _init_worker
with counter.get_lock():
AttributeError: 'ParallelTestSuite' object has no attribute 'get_lock'
(....)
}}}

How to reproduce:

1. I created a new virtualenv and a new Django project:

{{{
python3 -m venv venv
source venv/bin/activate
pip install --pre django
django-admin startproject woo
}}}

2. I created *two* test files:

`woo/test_something.py`:

{{{
from django.test import TestCase

class SomethingTestCase(TestCase):
def test_it_works(self):
pass
}}}

`woo/test_something_else.py`:

{{{
from django.test import TestCase

class SomethingTestCase(TestCase):
def test_it_works(self):
pass
}}}


3. I ran the tests with the --parallel flag:

{{{
./manage.py test --parallel
}}}

----

Django version: Django==4.1a1
Python version: 3.10.4
OS: Ubuntu 22.04

--
Ticket URL: <https://code.djangoproject.com/ticket/33719>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
May 18, 2022, 4:08:25 AM5/18/22
to django-...@googlegroups.com
#33719: Running tests in parallel throws exceptions in Django 4.1a1
-----------------------------------+--------------------------------------

Reporter: Pēteris Caune | Owner: nobody
Type: Bug | Status: new

Component: Testing framework | Version: 4.1
Severity: Normal | Resolution:

Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------------+--------------------------------------
Changes (by Pēteris Caune):

* type: Uncategorized => Bug


--
Ticket URL: <https://code.djangoproject.com/ticket/33719#comment:1>

Django

unread,
May 18, 2022, 4:09:03 AM5/18/22
to django-...@googlegroups.com
#33719: Running tests in parallel throws exceptions in Django 4.1a1
-----------------------------------+--------------------------------------
Reporter: Pēteris Caune | Owner: nobody
Type: Bug | Status: new
Component: Testing framework | Version: dev

Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------------+--------------------------------------
Changes (by Pēteris Caune):

* version: 4.1 => dev


--
Ticket URL: <https://code.djangoproject.com/ticket/33719#comment:2>

Reply all
Reply to author
Forward
0 new messages