Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#23649 closed Uncategorized (fixed)

Oracle GIS testing -- fails to destroy old leftover test database after unclean ending

Reported by: Shai Berger Owned by: Shai Berger
Component: Database layer (models, ORM) Version: dev
Severity: Normal Keywords: oracle testing geodjango gis
Cc: Tim Graham Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

If you run Django tests and they end without proper clean-up (e.g. the test process is forcibly killed) then the next test run will try to destroy the test-database before rebuilding it from scratch.

On Oracle GIS, this destroy-leftover-database process fails, because the backend tries to drop the test tablespace (DROP TABLESPACE TEST_DB INCLUDING CONTENTS), and for some reason the GIS artifacts make this fail.

The workaround is to drop first the test user (DROP USER TEST_USER CASCADE), but currently this needs to be done manually.

Change History (8)

comment:1 by Shai Berger, 10 years ago

Owner: changed from nobody to Shai Berger
Status: newassigned

comment:3 by Shai Berger, 10 years ago

Has patch: set

comment:4 by Shai Berger <shai@…>, 10 years ago

Resolution: fixed
Status: assignedclosed

In 2e1ed5f33cf5756b52a10ceadd0ce8e9ecf989e3:

Fixed #23649 -- Made Oracle test-db creation drop test-user earlier when needed

Checked database destruction for ORA-29857, which happens when objects of
some types are left over in an old test database (notably, such objects
are created by the GIS backend). When this happens, we can resolve the
issue by dropping the test-user (if we are allowed to).

An alternative approach, to just switch the order of creation (so that,
if the test user exists and can be dropped, it is always dropped before
the tablespace) was considered; but since the user creation depends on
the tablespace, this would necessitate separating the dropping of the user
from its creation -- a change I am reluctant to make.

Thanks Josh Smeaton and Tim Graham for reviews.

comment:5 by Shai Berger <shai@…>, 10 years ago

In a1578055e61e8815d1b6d445e8b24ad02d38c3ee:

[1.7.x] Fixed #23649 -- Made Oracle test-db creation drop test-user earlier when needed

Checked database destruction for ORA-29857, which happens when objects of
some types are left over in an old test database (notably, such objects
are created by the GIS backend). When this happens, we can resolve the
issue by dropping the test-user (if we are allowed to).

An alternative approach, to just switch the order of creation (so that,
if the test user exists and can be dropped, it is always dropped before
the tablespace) was considered; but since the user creation depends on
the tablespace, this would necessitate separating the dropping of the user
from its creation -- a change I am reluctant to make.

Thanks Josh Smeaton and Tim Graham for reviews.

Backport of 2e1ed5f33c from master

comment:6 by Tim Graham <timograham@…>, 10 years ago

In 6ce6c77e03fea68ef1bdadd45f15e403f5b71057:

Added 1.7.1 release notes for refs #23649.

comment:7 by Tim Graham <timograham@…>, 10 years ago

In 55a5f0b49a7adca008076fa0af6f67ef64d575d8:

[1.7.x] Added 1.7.1 release notes for refs #23649.

Backport of 6ce6c77e03 from master

comment:8 by Shai Berger, 10 years ago

Thanks, Tim, for adding the release notes I neglected.

Note: See TracTickets for help on using tickets.
Back to Top