[Django] #33183: keepdb results in "Using existing database" log line, even when no database exists

10 views
Skip to first unread message

Django

unread,
Oct 9, 2021, 1:00:46 PM10/9/21
to django-...@googlegroups.com
#33183: keepdb results in "Using existing database" log line, even when no database
exists
------------------------------------------------+------------------------
Reporter: valentijnscholten | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Testing framework | Version: 3.2
Severity: Normal | Keywords: keepdb
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
------------------------------------------------+------------------------
The log output for running tests with `--keepdb` can be confusing:

- make sure no test database exists
- run a test with `--keepdb`
- observe log output `Using existing test database for alias 'default'...`
- observe that a new test database is created now, without any log output
(unless there are migrations which output logs)

Solution:
Update log lines to reflect what's happening.

--
Ticket URL: <https://code.djangoproject.com/ticket/33183>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Oct 9, 2021, 1:15:41 PM10/9/21
to django-...@googlegroups.com
#33183: keepdb results in "Using existing database" log line, even when no database
exists
-------------------------------------+-------------------------------------
Reporter: Valentijn Scholten | Owner: nobody
Type: | Status: new
Cleanup/optimization |

Component: Testing framework | Version: 3.2
Severity: Normal | Resolution:

Keywords: keepdb | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Description changed by Valentijn Scholten:

Old description:

> The log output for running tests with `--keepdb` can be confusing:
>
> - make sure no test database exists
> - run a test with `--keepdb`
> - observe log output `Using existing test database for alias
> 'default'...`
> - observe that a new test database is created now, without any log output
> (unless there are migrations which output logs)
>
> Solution:
> Update log lines to reflect what's happening.

New description:

The log output for running tests with `--keepdb` can be confusing:

- make sure no test database exists
- run a test with `--keepdb`
- observe log output `Using existing test database for alias 'default'...`
- observe that a new test database is created now, without any log output
(unless there are migrations which output logs)

Offending code:
https://github.com/django/django/blob/ca9872905559026af82000e46cde6f7dedc897b6/django/db/backends/base/creation.py#L44

Solution:
Update log lines to reflect what's happening.

--

--
Ticket URL: <https://code.djangoproject.com/ticket/33183#comment:1>

Django

unread,
Oct 11, 2021, 12:06:44 AM10/11/21
to django-...@googlegroups.com
#33183: keepdb results in "Using existing database" log line, even when no database
exists
-------------------------------------+-------------------------------------
Reporter: Valentijn Scholten | Owner: nobody
Type: | Status: closed
Cleanup/optimization |
Component: Database layer | Version: 3.2
(models, ORM) |
Severity: Normal | Resolution: duplicate

Keywords: keepdb | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* status: new => closed
* resolution: => duplicate
* component: Testing framework => Database layer (models, ORM)


Comment:

Duplicate of #29043.

--
Ticket URL: <https://code.djangoproject.com/ticket/33183#comment:2>

Reply all
Reply to author
Forward
0 new messages