#26096: Django 1.9.1 sometimes fails to delete cloned testing postgres db
----------------------------------+--------------------------------------
Reporter: Alex3917 | Owner: nobody
Type: Bug | Status: new
Component: Uncategorized | Version: 1.9
Severity: Normal | Resolution:
Keywords: testing parallel | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
----------------------------------+--------------------------------------
Changes (by Alex3917):
* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0
Old description:
> I got this error running python manage.py test tests --parallel=2:
>
> “Got an error cloning the test database: unorderable types: str() >=
> int()”
>
> This continued happening when running the tests in parallel even when
> telling django to delete the existing db, but not when using
> --parallel=1.
>
> The full traceback is:
>
> Type 'yes' if you would like to try deleting the test database
> 'test_fwd_api', or 'no' to cancel: yes
> Destroying old test database for alias 'default'...
> Cloning test database for alias 'default'...
> Got an error cloning the test database: unorderable types: str() >= int()
> Traceback (most recent call last):
> File "/home/vagrant/user/.pyenv/versions/fwd343/lib/python3.4/site-
> packages/django/db/backends/utils.py", line 62, in execute
> return self.cursor.execute(sql)
> psycopg2.ProgrammingError: database "test_fwd_api_1" already exists
>
> The above exception was the direct cause of the following exception:
>
> Traceback (most recent call last):
> File "/home/vagrant/user/.pyenv/versions/fwd343/lib/python3.4/site-
> packages/django/db/backends/postgresql/creation.py", line 29, in
> _clone_test_db
> qn(target_database_name), qn(source_database_name)))
> File "/home/vagrant/user/.pyenv/versions/fwd343/lib/python3.4/site-
> packages/django/db/backends/utils.py", line 64, in execute
> return self.cursor.execute(sql, params)
> File "/home/vagrant/user/.pyenv/versions/fwd343/lib/python3.4/site-
> packages/django/db/utils.py", line 95, in __exit__
> six.reraise(dj_exc_type, dj_exc_value, traceback)
> File "/home/vagrant/user/.pyenv/versions/fwd343/lib/python3.4/site-
> packages/django/utils/six.py", line 685, in reraise
> raise value.with_traceback(tb)
> File "/home/vagrant/user/.pyenv/versions/fwd343/lib/python3.4/site-
> packages/django/db/backends/utils.py", line 62, in execute
> return self.cursor.execute(sql)
> django.db.utils.ProgrammingError: database "test_fwd_api_1" already
> exists
>
> During handling of the above exception, another exception occurred:
>
> Traceback (most recent call last):
> File "/home/vagrant/user/.pyenv/versions/fwd343/lib/python3.4/site-
> packages/django/db/backends/postgresql/creation.py", line 36, in
> _clone_test_db
> self._get_database_display_str(target_database_name, verbosity),
> File "/home/vagrant/user/.pyenv/versions/fwd343/lib/python3.4/site-
> packages/django/db/backends/base/creation.py", line 140, in
> _get_database_display_str
> (" ('%s')" % database_name) if verbosity >= 2 else '',
> TypeError: unorderable types: str() >= int()
>
> My stack: Django 1.9.1, Postgres 9.4, ubuntu trusty-64
New description:
I got this error running python manage.py test tests --parallel=2:
“Got an error cloning the test database: unorderable types: str() >=
int()”
This continued happening when running the tests in parallel even when
telling django to delete the existing db, but not when using --parallel=1.
The full traceback is:
{{{
Type 'yes' if you would like to try deleting the test database
'test_fwd_api', or 'no' to cancel: yes
Destroying old test database for alias 'default'...
Cloning test database for alias 'default'...
Got an error cloning the test database: unorderable types: str() >= int()
Traceback (most recent call last):
File "/home/vagrant/user/.pyenv/versions/fwd343/lib/python3.4/site-
packages/django/db/backends/utils.py", line 62, in execute
return self.cursor.execute(sql)
psycopg2.ProgrammingError: database "test_fwd_api_1" already exists
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/vagrant/user/.pyenv/versions/fwd343/lib/python3.4/site-
packages/django/db/backends/postgresql/creation.py", line 29, in
_clone_test_db
qn(target_database_name), qn(source_database_name)))
File "/home/vagrant/user/.pyenv/versions/fwd343/lib/python3.4/site-
packages/django/db/backends/utils.py", line 64, in execute
return self.cursor.execute(sql, params)
File "/home/vagrant/user/.pyenv/versions/fwd343/lib/python3.4/site-
packages/django/db/utils.py", line 95, in __exit__
six.reraise(dj_exc_type, dj_exc_value, traceback)
File "/home/vagrant/user/.pyenv/versions/fwd343/lib/python3.4/site-
packages/django/utils/six.py", line 685, in reraise
raise value.with_traceback(tb)
File "/home/vagrant/user/.pyenv/versions/fwd343/lib/python3.4/site-
packages/django/db/backends/utils.py", line 62, in execute
return self.cursor.execute(sql)
django.db.utils.ProgrammingError: database "test_fwd_api_1" already exists
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/vagrant/user/.pyenv/versions/fwd343/lib/python3.4/site-
packages/django/db/backends/postgresql/creation.py", line 36, in
_clone_test_db
self._get_database_display_str(target_database_name, verbosity),
File "/home/vagrant/user/.pyenv/versions/fwd343/lib/python3.4/site-
packages/django/db/backends/base/creation.py", line 140, in
_get_database_display_str
(" ('%s')" % database_name) if verbosity >= 2 else '',
TypeError: unorderable types: str() >= int()
}}}
My stack: Django 1.9.1, Postgres 9.4, ubuntu trusty-64
--
--
Ticket URL: <https://code.djangoproject.com/ticket/26096#comment:1>
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 post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/066.a0b8599da3bdacce8f9078cd753256a6%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.