Changes between Initial Version and Version 1 of Ticket #31169


Ignore:
Timestamp:
Jan 15, 2020, 2:39:04 AM (5 years ago)
Author:
Brandon Navra
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #31169 – Description

    initial v1  
    11Python 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.
    22
    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.
     3When 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.
    44
    55I 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.
Back to Top