#14799 closed (fixed)
Test database creation order problem after r14696
Reported by: | Russell Keith-Magee | Owned by: | Russell Keith-Magee |
---|---|---|---|
Component: | Testing framework | Version: | 1.2 |
Severity: | Keywords: | ||
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | yes |
Easy pickings: | no | UI/UX: | no |
Description
r14696 added a fix for #14415, changing the way test databases are created to ensure that the test setup/teardown process doesn't accidentally destroy the original source database.
However, in the process, it made the test database creation order subject to dictionary ordering. This is problematic because some database have dependencies on other databases during creation.
For example, Django's own test suite won't run if 'other' is created before 'default' because the post_syncdb signal causes a ContentTypes query to be issued, which will try to execute on the default database. If the default database hasn't been created, an error arises.
This is currently causing the buildbots to fail for Postgres.
Attachments (1)
Change History (7)
by , 14 years ago
Attachment: | t14799.diff added |
---|
comment:1 by , 14 years ago
Has patch: | set |
---|---|
Owner: | changed from | to
Patch needs improvement: | set |
Status: | new → assigned |
Triage Stage: | Unreviewed → Accepted |
Here's a draft fix for the problem -- it introduces the concept of TEST_DEPENDENCIES, so you can specify which databases must be synchronized before others. By default, every database is assumed to be dependent on 'default' (except, of course, for default itself). This seems to be enough to make Django's test suite run.
comment:2 by , 14 years ago
(In [14756]) Ensured that the test suite creates the default DB before any others.
Refs #14799. Technically this fixes the problem, but I'm far from convinced
it's the perfect solution, so I'm leaving the ticket open. I'm committing
this now because it's the minimum required to get the test suite running
again, but this commit can -- and probably should -- be reverted in favor of
a more holistic fix later on.
comment:3 by , 14 years ago
comment:4 by , 14 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Draft fix for problem.