Changes between Initial Version and Version 1 of Ticket #31169
- Timestamp:
- Jan 15, 2020, 2:39:04 AM (5 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #31169 – Description
initial v1 1 1 Python 3.8 on MacOS has changed the default start method for the multiprocessing module from `fork` to `spawn`: https://docs.python.org/3/library/multiprocessing.html#contexts-and-start-methods. 2 2 3 When running tests with the `--parallel` flag, this causes the worker processes to fail with {{{django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet.}}} as they no longer have a copy of the parent memory state. It can also cause the workers to fail to find the cloned dbs ( {{django.db.utils.OperationalError: FATAL: database "xxx_1" does not exist}}) as the db test prefix is missing.3 When running tests with the `--parallel` flag, this causes the worker processes to fail with {{{django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet.}}} as they no longer have a copy of the parent memory state. It can also cause the workers to fail to find the cloned dbs ( {{django.db.utils.OperationalError: FATAL: database "xxx_1" does not exist}} ) as the db test prefix is missing. 4 4 5 5 I have attached a patch which changes `django.test.runner._init_worker` (the worker initialiser for `ParallelTestSuite`) to run django.setup() and set the db name to one with the `test_` prefix.