[Django] #25540: Reusing databases doesn't work on PostgreSQL for migrations tests

5 views
Skip to first unread message

Django

unread,
Oct 11, 2015, 4:50:22 AM10/11/15
to django-...@googlegroups.com
#25540: Reusing databases doesn't work on PostgreSQL for migrations tests
---------------------------------------------+------------------------
Reporter: akaariai | Owner: nobody
Type: Bug | Status: new
Component: Testing framework | Version: master
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 |
---------------------------------------------+------------------------
Running migrations tests with keepdb results in failures for the second
run. To reproduce:
{{{
./runpython --settings=<your_postgresql_settings> --keepdb migrations
# success
./runpython --settings=<your_postgresql_settings> --keepdb migrations
# Lots of failures.
}}}

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

Django

unread,
Oct 11, 2015, 7:52:52 AM10/11/15
to django-...@googlegroups.com
#25540: Reusing databases doesn't work on PostgreSQL for migrations tests
-----------------------------------+------------------------------------

Reporter: akaariai | Owner: nobody
Type: Bug | Status: new
Component: Testing framework | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------------+------------------------------------
Changes (by claudep):

* stage: Unreviewed => Accepted


Old description:

> Running migrations tests with keepdb results in failures for the second
> run. To reproduce:
> {{{
> ./runpython --settings=<your_postgresql_settings> --keepdb migrations
> # success
> ./runpython --settings=<your_postgresql_settings> --keepdb migrations
> # Lots of failures.
> }}}

New description:

Running migrations tests with keepdb results in failures for the second
run. To reproduce:
{{{

./runtests,py --settings=<your_postgresql_settings> --keepdb migrations
# success
./runtests.py --settings=<your_postgresql_settings> --keepdb migrations
# Lots of failures.
}}}

--

Comment:

This also happens on 1.8.

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

Django

unread,
Oct 11, 2015, 7:53:08 AM10/11/15
to django-...@googlegroups.com
#25540: Reusing databases doesn't work on PostgreSQL for migrations tests
-----------------------------------+------------------------------------

Reporter: akaariai | Owner: nobody
Type: Bug | Status: new
Component: Testing framework | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------------+------------------------------------
Description changed by claudep:

Old description:

> Running migrations tests with keepdb results in failures for the second
> run. To reproduce:
> {{{

> ./runtests,py --settings=<your_postgresql_settings> --keepdb migrations
> # success
> ./runtests.py --settings=<your_postgresql_settings> --keepdb migrations
> # Lots of failures.
> }}}

New description:

Running migrations tests with keepdb results in failures for the second
run. To reproduce:
{{{

./runtests.py --settings=<your_postgresql_settings> --keepdb migrations
# success
./runtests.py --settings=<your_postgresql_settings> --keepdb migrations
# Lots of failures.
}}}

--

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

Django

unread,
Dec 22, 2016, 12:25:12 PM12/22/16
to django-...@googlegroups.com
#25540: Reusing databases doesn't work on PostgreSQL for migrations tests
-----------------------------------+------------------------------------
Reporter: Anssi Kääriäinen | Owner: nobody

Type: Bug | Status: new
Component: Testing framework | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------------+------------------------------------
Changes (by Tim Graham):

* Attachment "25540-init.diff" added.

Django

unread,
Dec 22, 2016, 12:25:57 PM12/22/16
to django-...@googlegroups.com
#25540: Reusing databases doesn't work on PostgreSQL for migrations tests
----------------------------------+------------------------------------
Reporter: Anssi Kääriäinen | Owner: nobody
Type: Bug | Status: new
Component: Migrations | Version: master

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
----------------------------------+------------------------------------
Changes (by Tim Graham):

* component: Testing framework => Migrations


Comment:

I attached a patch to get someone started. I used the following workflow:

`./runtests.py --settings=test_postgres migrations --parallel=1 --noinput
--keepdb --failfast`
(no errors)
`./runtests.py --settings=test_postgres migrations --parallel=1 --noinput
--keepdb --failfast`

At this point you can observe and fix the next failure. With my patch
applied, the next failure I see is
test_regression_22823_unmigrated_fk_to_migrated_model
(migrations.test_commands.MigrateTests). It's helpful to use pgAdmin to
examine the state of the test database.

After you add a possible fix for thetest, run the tests without --keepdb
to clear the bad state from the database. You can then repeat these steps
from the top.
`./runtests.py --settings=test_postgres migrations --parallel=1 --noinput`

--
Ticket URL: <https://code.djangoproject.com/ticket/25540#comment:3>

Django

unread,
Mar 18, 2024, 3:18:14 AM3/18/24
to django-...@googlegroups.com
#25540: Reusing databases doesn't work on PostgreSQL for migrations tests
----------------------------------+------------------------------------
Reporter: Anssi Kääriäinen | Owner: nobody
Type: Bug | Status: new
Component: Migrations | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
----------------------------------+------------------------------------
Changes (by Ülgen Sarıkavak):

* cc: Ülgen Sarıkavak (added)

--
Ticket URL: <https://code.djangoproject.com/ticket/25540#comment:4>
Reply all
Reply to author
Forward
0 new messages