Django system tests freezes on my machine with default settings (sqlite),
so I decided to try `postgresql` as backend.
I created user with CREATEDB permissions and replaced DB settings with
{{{
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'USER': 'test',
'PASSWORD': 'test',
'HOST': 'localhost',
'NAME': 'test_d'
},
'other': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'USER': 'test',
'PASSWORD': 'test',
'HOST': 'localhost',
'NAME': 'test_o',
}
}
}}}
After that I got an error:
{{{
django.db.utils.OperationalError: FATAL: database "test_d" does not exist
}}}
When docs says:
{{{
Test databases get their names by prepending test_ to the value of the
NAME settings for the databases defined in DATABASES. These test databases
are deleted when the tests are finished.
}}}
I'm waiting that `runtests` will create `test_test_o` and `test_test_d`
for me and I no need in `test_d` and `test_o` databases at all.
Maybe I'm doing something wrong or docs should be improved?
P.S. After I created dbs manually, I got:
{{{
psycopg2.ProgrammingError: permission denied to create extension "hstore".
HINT: Must be superuser to create this extension.
}}}
Mb it's engine specific error, I'm not sure.
--
Ticket URL: <https://code.djangoproject.com/ticket/27160>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* needs_better_patch: => 0
* needs_docs: => 0
* stage: Unreviewed => Accepted
* needs_tests: => 0
Comment:
I'll document these requirements when I get a chance.
It could be nice to remove the requirement of creating the databases, but
I'm not sure how feasible this is. The problem looks like it's caused by
module level queries for detecting database features.
--
Ticket URL: <https://code.djangoproject.com/ticket/27160#comment:1>
Comment (by cjerdonek):
Django system tests freezes on my machine with default settings (sqlite)
Can you say more about this, like what OS you are using and what you mean
when you say the tests "freeze" (e.g. what is happening exactly)? I'm
wondering if it's related to ticket #27086 that I filed recently. It seems
like the freezing is the more fundamental problem, since that shouldn't be
happening in the first place, right?
--
Ticket URL: <https://code.djangoproject.com/ticket/27160#comment:2>
Comment (by pacahon):
Replying to [comment:2 cjerdonek]:
> Django system tests freezes on my machine with default settings
(sqlite)
>
> Can you say more about this, like what OS you are using and what you
mean when you say the tests "freeze" (e.g. what is happening exactly)?
I'm wondering if it's related to ticket #27086 that I filed recently. It
seems like the freezing is the more fundamental problem, since that
shouldn't be happening in the first place, right?
OS X 10.10.5, python 3.4.3 under venv, stable/1.9.x branch
With `python tests/runtests.py --parallel=1 -v3 admin_views` I get
`Segmentation Fault 11`:
{{{
...
test_named_group_field_choices_filter
(admin_views.tests.AdminViewBasicTest) ... ok
test_popup_add_POST (admin_views.tests.AdminViewBasicTest) ... ok
test_popup_dismiss_related (admin_views.tests.AdminViewBasicTest) ... ok
Segmentation fault: 11
}}}
Don't know what the next testcase, no output name for it.
Without `--parallel=1` it suddenly hang on different testcases
{{{
# python tests/runtests.py -v3
test_default_and_given_options
(test_runner.tests.CustomTestRunnerOptionsTests) ... ok
test_default_options (test_runner.tests.CustomTestRunnerOptionsTests) ...
ok
test_option_name_and_value_separated
(test_runner.tests.CustomTestRunnerOptionsTests) ... ok
test_output_normal (test_runner.test_debug_sql.TestDebugSQL) ... ok
test_output_verbose (test_runner.test_debug_sql.TestDebugSQL) ... ok
# hang, zero CPU activity on each child process
}}}
{{{
# python tests/runtests.py -v3 admin_views
test_user_fk_delete_popup (admin_views.tests.UserAdminTest)
User deletion through a FK popup should return the appropriate JavaScript
response. ... ok
test_user_permission_performance (admin_views.tests.UserAdminTest) ... ok
# the same, hang with 0 CPU activity
}}}
I guess we should continue in #27086?
--
Ticket URL: <https://code.djangoproject.com/ticket/27160#comment:3>
Comment (by timgraham):
I think that's a bug in SQLite, see ticket:24080#comment:51.
--
Ticket URL: <https://code.djangoproject.com/ticket/27160#comment:4>
Comment (by pacahon):
After upgrading sqlite3, segfault is gone, but hanging is still occurs.
--
Ticket URL: <https://code.djangoproject.com/ticket/27160#comment:5>
* status: new => closed
* resolution: => worksforme
Comment:
Maybe this ticket is not valid anymore.
In Testing Overview for version 3, it is already states that requires an
user with sufficient privileges
> On PostgreSQL, USER will also need read access to the built-in postgres
database.\\ \\Aside from using a separate database, the test runner will
otherwise use all of the same database settings you have in your settings
file: ENGINE, USER, HOST, etc. The test database is created by the user
specified by USER, so you’ll need to make sure that the given user account
has sufficient privileges to create a new database on the system.
[https://docs.djangoproject.com/en/3.0/topics/testing/overview/]
--
Ticket URL: <https://code.djangoproject.com/ticket/27160#comment:6>