Fixed #36083 -- Ran system checks in ParallelTestSuite workers.
Some checks are pending
Linters / flake8 (push) Waiting to run
Linters / isort (push) Waiting to run
Linters / black (push) Waiting to run
Tests / Windows, SQLite, Python 3.13 (push) Waiting to run
Tests / JavaScript tests (push) Waiting to run

Workers created by ParallelTestSuite were not running system
checks in the spawn multiprocessing mode. In general this is
fine, but system checks can have side effects expected by tests.

This patch runs system checks inside of _init_worker, which is
only called by ParallelTestSuite.
This commit is contained in:
Adam Zapletal 2025-01-18 16:22:10 -06:00 committed by Jacob Walls
parent 2063c88c34
commit 606fc35279
3 changed files with 16 additions and 1 deletions

View file

@ -6,6 +6,13 @@ class Person(models.Model):
last_name = models.CharField(max_length=20)
friends = models.ManyToManyField("self")
system_check_run_count = 0
@classmethod
def check(cls, *args, **kwargs):
cls.system_check_run_count += 1
return super().check(**kwargs)
# A set of models that use a non-abstract inherited 'through' model.
class ThroughBase(models.Model):