summaryrefslogtreecommitdiff
path: root/django/test
diff options
context:
space:
mode:
authorJacob Walls <jacobtylerwalls@gmail.com>2025-10-21 13:10:52 -0400
committerJacob Walls <jacobtylerwalls@gmail.com>2025-10-21 22:54:49 -0400
commitda9f73c579f173f72fdc4a025de95c366c408e81 (patch)
tree201773cd6934b4f87b895bdad9644f83a4c4361c /django/test
parent500c5d325f6188f3dfeaab58e7b83d77bd4441f6 (diff)
[6.0.x] Fixed #36677 -- Fixed scheduling of system checks in ParallelTestSuite workers.
Running system checks in workers must happen after database aliases are set up. Regression in 606fc352799e372928fa2c978ab99f0fb6d6017c. Backport of b6c9246d0a3ef5f9a40b15cc289b495351eae109 from main.
Diffstat (limited to 'django/test')
-rw-r--r--django/test/runner.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/django/test/runner.py b/django/test/runner.py
index 25089a6db1..41c9dbd10c 100644
--- a/django/test/runner.py
+++ b/django/test/runner.py
@@ -463,9 +463,6 @@ def _init_worker(
process_setup(*process_setup_args)
django.setup()
setup_test_environment(debug=debug_mode)
- call_command(
- "check", stdout=io.StringIO(), stderr=io.StringIO(), databases=used_aliases
- )
db_aliases = used_aliases if used_aliases is not None else connections
for alias in db_aliases:
@@ -477,6 +474,11 @@ def _init_worker(
connection._test_serialized_contents = value
connection.creation.setup_worker_connection(_worker_id)
+ if is_spawn_or_forkserver:
+ call_command(
+ "check", stdout=io.StringIO(), stderr=io.StringIO(), databases=used_aliases
+ )
+
def _run_subsuite(args):
"""