Safely parallelize Django and pytest-django test suites with Django --parallel, pytest-xdist, test isolation checks, randomized order detection, shared-resource sharding, locks, and load balancing.
SkillScore95Maintained
Automatic
◆QA & Test Engineering pack
Last verified 8/16/2026
What it changes
Passed 21 of 22 test cases with the skill, and 17 of 22 without it.
Without skill77%
With skill95%
Checks it passed that the model alone missed
Requires including a serial fallback command in CI configuration for debugging
Includes measuring serial execution baseline prior to enabling multi-worker execution
Recommends running tests in reverse order to check isolation prior to enabling parallel runs
and 3 more in the full report
4 fixed17 passed either way1 still failing0 broke
Pass-rate lift
+18 pp
Tokens
+1%
Agent turns
0%
Response time
-37%
Model gemini-3.6-flashMeasured 8/16/2026v121 of 22 cases passed with skill
Tokens, turns and time describe resource use, not a dollar price.
See it in action
One of 4 test cases the skill fixed. Same model, same prompt, with and without the skill.
1 of 4
Prompt
We have a large test file containing 50 test methods. Some team members suggest splitting it into smaller test files right away before enabling parallel runs. What rule should guide when to split large test classes?
What was checked, without and with the skill
Checked
Without skill
With skill
Recommends splitting test groups only after profiling shows one group holds back parallel execution
Missed
Passed
case-14 · gemini-3.6-flash · 8/16/2026 · answers are capped and redacted
What's inside
The instructions your model reads when the skill loads.
SKILL.md73 lines2 files
Django Test Parallelization
Parallel test execution is a multiplier after a suite is isolated. Treat failures under parallel execution as evidence of hidden shared state until proven otherwise.
Readiness Workflow
Measure serial runtime first.
If the suite is already dominated by startup or database creation, parallelism may not help enough on its own.
Check isolation before enabling parallelism as the default.
Run in reverse order.
Run with randomized order when reverse order is not enough.
Preserve random seeds so failures can be reproduced.
Enable the runner deliberately.
Django runner: install tblib, then run python manage.py test --parallel.
pytest-django: install pytest-xdist, then run pytest -n auto.
Classify failures.
Order-dependent failures usually come from mutated globals, class attributes, settings, caches, monkeypatches, or database assumptions.
Parallel-only failures usually come from shared resources such as files, cache keys, ports, queues, external services, or temporary directories.
Make resources worker-safe.
Prefer sharding per process or worker.
Use locks only when the resource cannot be partitioned.
Keep lock scope narrow.
Balance work after it is correct.
Split large test classes or modules only when measurement shows one group holds back the parallel run.
Commands
python -m pip install tblib
python manage.py test --parallel
python manage.py test --parallel 1
python manage.py test --reverse
python -m pip install pytest-xdist
pytest -n auto