Cool! I think this is a great topic.
Previously we’ve been able to run the test suite in parallel on Linux and macOS.
With Python 3.8, the default (
multiprocessing) start method on macOS went from
fork is deprecated and will be removed in a future version of macOS. For now, you can work around it, by setting it back to
fork, but this means we we’re down to just Linux for parallel test execution (on Python 3.8+)
It would be good to get it going with the
spawn method, so we can run at full speed on macOS and Windows too.
On macOS with Python 3.8+ or Windows (with any supported Python) run the django test suite, a project’s tests with
./manage.py test using the
--parallel=4 (say) flag. You’ll see lots of errors (most are
The trick will be to work out how to adjust
django/test/runner.py::_init_worker() to set the right data.
It’s a nice project because you get to dig right into the multiprocessing module: what exactly is the difference between
spawn? (OK, “environment and file descriptors are not shared…” — but what does that mean? ) Then there’s working out how to get the right DB connections to each worker, and… And then there’s testing across platforms. And…
I’d first of all review the original ticket and discussions. Did this issue come up when it was first implemented? (Windows support would surely have been mentioned…)
Hopefully that gets you started.