#36496: SQLite test database path not recognised when running tests in parallel
-------------------------------------+-------------------------------------
     Reporter:  Damian Posener       |                     Type:  Bug
       Status:  new                  |                Component:  Testing
                                     |  framework
      Version:  5.2                  |                 Severity:  Normal
     Keywords:                       |             Triage Stage:
                                     |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
 How to replicate:

 1. Have a DATABASES configuration with one or more SQLite DBs in
 directories, like this:
 {{{
 DATABASES = {
     'default': {
         'ENGINE': 'django.db.backends.sqlite3',
         'NAME': BASE_DIR / 'db' / 'default' / 'db.sqlite3',
     },
     'other': {
         'ENGINE': 'django.db.backends.sqlite3',
         'NAME': BASE_DIR / 'db' / 'other' / 'db.sqlite3',
     }
 }
 }}}
 2. Run tests with both the `--parallel=auto` and `--keepdb` flags, i.e.
 `python manage.py test --keepdb --parallel=auto`

 Expected behaviour: `.sqlite3` files should be kept in `db/default` and
 `db/other` directories

 Actual behaviour: `default_X.sqlite3` and `other_X.sqlite3` files are
 saved in the root directory instead

 Why is this a problem? When running multiple test suites at once, this
 leads to filename collision if two test suites are using the same database
 name(s). It is impossible to run two Django test suites in parallel from
 the same directory without encountering this issue.

 Setting `DATABASES['<alias>']['TEST']['NAME']` does not seem to solve this
 either.

 I've put together an example project to demonstrate the issue. Simply run
 `python manage.py test --keepdb --parallel=auto` from the base directory.

 Happy to answer any other questions. :)
-- 
Ticket URL: <https://code.djangoproject.com/ticket/36496>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/django-updates/01070197e45c6dc4-15f5ebbd-3c92-469a-84d5-a80867d60b04-000000%40eu-central-1.amazonses.com.

Reply via email to