Oracle/GIS Testers Needed

11 views
Skip to first unread message

Alex Gaynor

unread,
Nov 20, 2009, 1:14:37 AM11/20/09
to django-d...@googlegroups.com
Hey all,

Russ and I have been working on getting the multi-db work ready for
merge (final stretch here hopefully!), and I just ported the Oracle
backend to the slightly updated backend arcitecture so it could use
some testers. If you've got an Oracle setup and can run some tests
that would be great. You can grab the code here:

http://github.com/alex/django/tree/multiple-db

Make sure you use the multiple-db branch. I understand running the
tests under Oracle can be a bit slow, so perhaps start by just running
the "queries" tests, if they fail please reply with the complete
tracebacks and such here, otherwise if you have the time a shot at
running the full test suite would be great.

For GIS I'm fairly certain that's broken, however I'm not quite setup
for running the GIS tests yet, therefore if you're set up for it and
can run the tests please just reply with your tracebacks here
(preferably with them on a pastebin like paste.pocoo.org though :))
and I'll try to sort it out.

Thanks all,
Alex

--
"I disapprove of what you say, but I will defend to the death your
right to say it." -- Voltaire
"The people's good is the highest law." -- Cicero
"Code can always be simpler than you think, but never as simple as you
want" -- Me

Jani Tiainen

unread,
Nov 20, 2009, 2:19:12 AM11/20/09
to django-d...@googlegroups.com
On Fri, 2009-11-20 at 01:14 -0500, Alex Gaynor wrote:
> Hey all,
>
> Russ and I have been working on getting the multi-db work ready for
> merge (final stretch here hopefully!), and I just ported the Oracle
> backend to the slightly updated backend arcitecture so it could use
> some testers. If you've got an Oracle setup and can run some tests
> that would be great. You can grab the code here:
>
> http://github.com/alex/django/tree/multiple-db
>
> Make sure you use the multiple-db branch. I understand running the
> tests under Oracle can be a bit slow, so perhaps start by just running
> the "queries" tests, if they fail please reply with the complete
> tracebacks and such here, otherwise if you have the time a shot at
> running the full test suite would be great.
>
> For GIS I'm fairly certain that's broken, however I'm not quite setup
> for running the GIS tests yet, therefore if you're set up for it and
> can run the tests please just reply with your tracebacks here
> (preferably with them on a pastebin like paste.pocoo.org though :))
> and I'll try to sort it out.
>
> Thanks all,
> Alex
>

We can try to run and experiment all that since we need multidb support
and we run Oracle with heavy GIS stuff.

Is there any special requirements that I need to take account before
running tests?

--

Jani Tiainen



Russell Keith-Magee

unread,
Nov 20, 2009, 5:53:34 AM11/20/09
to django-d...@googlegroups.com
Thanks for the offer. For the moment, only the Oracle stuff requires
testing - GIS will need testing soon. We'll be sure to tap you on the
shoulder again when the GIS stuff is ready :-)

> Is there any special requirements that I need to take account before
> running tests?

For the moment, the priority isn't testing anything specifically
multi-database. We've made a lot of fairly big changes to the
internals of queries, and we just need to check that the N=1 case
still works across the board.

So - all you need to do is follow the normal Django testing requirements [1].

[1] http://docs.djangoproject.com/en/dev/internals/contributing/#running-the-unit-tests

Yours,
Russ Magee %-)

Karen Tracey

unread,
Nov 20, 2009, 8:26:37 AM11/20/09
to django-d...@googlegroups.com
On Fri, Nov 20, 2009 at 1:14 AM, Alex Gaynor <alex....@gmail.com> wrote:
Hey all,

Russ and I have been working on getting the multi-db work ready for
merge (final stretch here hopefully!), and I just ported the Oracle
backend to the slightly updated backend arcitecture so it could use
some testers.  If you've got an Oracle setup and can run some tests
that would be great.  You can grab the code here:

http://github.com/alex/django/tree/multiple-db

Make sure you use the multiple-db branch.  I understand running the
tests under Oracle can be a bit slow, so perhaps start by just running
the "queries" tests, if they fail please reply with the complete
tracebacks and such here, otherwise if you have the time a shot at
running the full test suite would be great.


The queries test ran OK once I removed:

from django.db.backends.oracle import query

from django/db/backends/oracle/base.py

I guessed based on the fact that django/db/backends/oracle/query.py was removed in the last commit that the import was leftover from a restructuring. I am not sure but it looks like there may also be some other dead stuff referencing this query module (the query_class method in DatabaseOperations?), but I did not touch that, just removed that one import. 

I've got the full suite running now, but that will take a while.

So far I am testing with just Oracle backend specified.  The last time I tested this branch I also had a test config that specified multiple dbs -- a default and an extra one.  Not sure if you wanted to test that at this point so I started with the simpler one.

Karen

Alex Gaynor

unread,
Nov 20, 2009, 10:17:57 AM11/20/09
to django-d...@googlegroups.com
> --
>
> You received this message because you are subscribed to the Google Groups
> "Django developers" group.
> To post to this group, send email to django-d...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-develop...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-developers?hl=.
>

Just running the Oracle tests is enough for now. I've fixed the error
you spotted with the stray import left over and pushed that to github.

Thanks,

ben

unread,
Nov 20, 2009, 11:03:05 AM11/20/09
to Django developers
Hi Alex,

I have oracle at work with all versions from 9i to 11. I'd be happy to
run the tests on all of those verisons. I wonder if I could ask a
small favour in return though:

In our organisation we have a lot of legacy date/time data modeled as
the year 0001-01-01 and then the time in situations where the time is
all we're interested in. This is currently causing a headache due to
http://code.djangoproject.com/ticket/10866 which has a patch and is
ready for checkin. The patch is basically a one character change to
datetime_safe.py which zero pads dates with year < 1000. Would you
mind fixing it?

Cheers,
Ben

On Nov 20, 3:17 pm, Alex Gaynor <alex.gay...@gmail.com> wrote:
> On Fri, Nov 20, 2009 at 8:26 AM, Karen Tracey <kmtra...@gmail.com> wrote:

Alex Gaynor

unread,
Nov 20, 2009, 11:06:25 AM11/20/09
to django-d...@googlegroups.com
I'm not familiar with that ticket, nor the issues surrounding it, so
I'd be uncomfortable applying a patch in any event, further that
ticket isn't specific to my branch so it should go through the normal
process of being committed to trunk, then I'll happily merge it in.

Thanks for offering to run the tests!

ben

unread,
Nov 20, 2009, 11:16:58 AM11/20/09
to Django developers
No problem, I'll try and spin up some test db's of various versions
next week.

Just to exlpain; the issue is that any date with a year less than 1000
is being output padded with spaces (so year 0001 ends up as u' 1').
This means that serialization is broken for these dates.

At the moment as a workaround I've manually patched my django, but
just wanted to flag the ticket as marked "ready for checkin". Where/
who would be the best place to direct this? I know things are hectic
at the moment with 1.2 etc, should I start another thread here (I
don't want to hijack you branch specific stuff any further)?

Cheers,
Ben

On Nov 20, 4:06 pm, Alex Gaynor <alex.gay...@gmail.com> wrote:
> On Fri, Nov 20, 2009 at 11:03 AM, ben <ben.for...@gmail.com> wrote:
> > Hi Alex,
>
> > I have oracle at work with all versions from 9i to 11. I'd be happy to
> > run the tests on all of those verisons. I wonder if I could ask a
> > small favour in return though:
>
> > In our organisation we have a lot of legacy date/time data modeled as
> > the year 0001-01-01 and then the time in situations where the time is
> > all we're interested in. This is currently causing a headache due to
> >http://code.djangoproject.com/ticket/10866which has a patch and is
> > For more options, visit this group athttp://groups.google.com/group/django-developers?hl=.

Karen Tracey

unread,
Nov 20, 2009, 3:56:38 PM11/20/09
to django-d...@googlegroups.com
Just running the Oracle tests is enough for now.  I've fixed the error
you spotted with the stray import left over and pushed that to github.

I get 6 failures and 26 errors but I do not know if any of them have anything to do with multidb.  The output is here:

http://pastebin.com/m2c763672

By contrast on trunk I get 7 failures and 26 errors:

http://pastebin.com/mf7c57a6

The unable to create INITIAL extent errors are new -- I've not seen them before, but I am getting some on trunk as well as multidb (though more on multidb).  I get the impression it may mean my install has some limits on how big things can grow, and tests are now exceeding those limits.  Not sure, and I don't have time to spend on trying to figure it out right now. 

Nor do I have time to see which failure goes away with multidb, sorry -- so I figured I'd just post out the results and you can take a look if you think it would be useful.

Karen

Alex Gaynor

unread,
Nov 20, 2009, 6:36:00 PM11/20/09
to django-d...@googlegroups.com
> --
>
> You received this message because you are subscribed to the Google Groups
> "Django developers" group.
> To post to this group, send email to django-d...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-develop...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-developers?hl=.
>

Thanks!

Unfortunately i have basically no idea what any of those Oracle bugs
mean. However, the few non-frightening errors I saw all also appeared
on trunk, so I guess my refactor basically didn't break anything.

Justin Bronn

unread,
Nov 20, 2009, 10:52:45 PM11/20/09
to Django developers

> For GIS I'm fairly certain that's broken, however I'm not quite setup
> for running the GIS tests yet, therefore if you're set up for it and
> can run the tests please just reply with your tracebacks here
> (preferably with them on a pastebin like paste.pocoo.org though :))
> and I'll try to sort it out.

Yes, multi-db is seriously broken with GIS on all backends (it'd be
pointless to list all the errors here). Basically, the massive shift
of `Query` internals to `SQLCompiler` is the root of the problem --
there needs to be a corresponding `GeoSQLCompiler` with `GeoQuerySet`
and `GeoQuery` wired to use it accordingly. I'll try to look at it in
more detail this weekend and see if I can sketch out a better idea of
what needs to be done, but so far it's looking "non-trivial."

-Justin

Alex Gaynor

unread,
Nov 20, 2009, 10:55:40 PM11/20/09
to django-d...@googlegroups.com
> --
>
> You received this message because you are subscribed to the Google Groups "Django developers" group.
> To post to this group, send email to django-d...@googlegroups.com.
> To unsubscribe from this group, send email to django-develop...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/django-developers?hl=.
>
>
>

Thanks for taking a look Justin. I won't have time to look into it
myself this weekend, but if you have any questions feel free to ask
here on IRC and I can try to help. Otherwise I will have time this
coming week and can hopefully start digging into this, as it's
probably the single most important tihng to fix up.

redetin

unread,
Nov 24, 2009, 5:09:37 PM11/24/09
to django-d...@googlegroups.com

Initial extent errors happens because datafile allocated for  temporary tablespace is full. It's hardcoded in django/db/backends/oracle/creation.py:L159,L163 (in trunk) to be 100M(bytes) which apparently is not enough anymore. Too bad that it's so late that I don't have time to test how much space tests actually needs now but it's definitely more than 100M.

--

Jani Tiainen



Jani Tiainen

unread,
Nov 26, 2009, 2:21:34 AM11/26/09
to django-d...@googlegroups.com
On Fri, 2009-11-20 at 01:14 -0500, Alex Gaynor wrote:
> Hey all,
>
> Russ and I have been working on getting the multi-db work ready for
> merge (final stretch here hopefully!), and I just ported the Oracle
> backend to the slightly updated backend arcitecture so it could use
> some testers. If you've got an Oracle setup and can run some tests
> that would be great. You can grab the code here:
>
> http://github.com/alex/django/tree/multiple-db
>
> Make sure you use the multiple-db branch. I understand running the
> tests under Oracle can be a bit slow, so perhaps start by just running
> the "queries" tests, if they fail please reply with the complete
> tracebacks and such here, otherwise if you have the time a shot at
> running the full test suite would be great.
>

I did ran full test suite. First at maximum tablespace size must be
set bit over 100MB (I changed it to 200MB but in tests I had peak of
102MB)

And then bunch of interesting errors:

======================================================================
ERROR: Multi-db fixtures are loaded correctly
----------------------------------------------------------------------
Traceback (most recent call last):
File
"/home/jtiai/src/django/multidb/tests/regressiontests/multiple_database/tests.py",
line 467, in test_fixture_loading
title="Pro Django"
File "/usr/lib/python2.6/unittest.py", line 336, in failUnlessRaises
callableObj(*args, **kwargs)
File "/home/jtiai/src/django/multidb/django/db/models/query.py",
line 300, in get
num = len(clone)
File "/home/jtiai/src/django/multidb/django/db/models/query.py",
line 77, in __len__
self._result_cache = list(self.iterator())
File "/home/jtiai/src/django/multidb/django/db/models/query.py",
line 234, in iterator
compiler = self.query.get_compiler(using=self.db)
File "/home/jtiai/src/django/multidb/django/db/models/sql/query.py",
line 148, in get_compiler
connection = connections[using]
File "/home/jtiai/src/django/multidb/django/db/utils.py", line
68, in __getitem__
self.ensure_defaults(alias)
File "/home/jtiai/src/django/multidb/django/db/utils.py", line
54, in ensure_defaults
raise ConnectionDoesNotExist("The connection %s doesn't exist" %
alias)
ConnectionDoesNotExist: The connection other doesn't exist

======================================================================
ERROR: Queries are constrained to a single database
----------------------------------------------------------------------
Traceback (most recent call last):
File
"/home/jtiai/src/django/multidb/tests/regressiontests/multiple_database/tests.py",
line 100, in test_basic_queries
published=datetime.date(2009, 5, 4))
File "/home/jtiai/src/django/multidb/django/db/models/query.py",
line 315, in create
obj.save(force_insert=True, using=self.db)
File "/home/jtiai/src/django/multidb/django/db/models/base.py",
line 429, in save
self.save_base(using=using, force_insert=force_insert,
force_update=force_update)
File "/home/jtiai/src/django/multidb/django/db/models/base.py",
line 442, in save_base
connection = connections[using]
File "/home/jtiai/src/django/multidb/django/db/utils.py", line
68, in __getitem__
self.ensure_defaults(alias)
File "/home/jtiai/src/django/multidb/django/db/utils.py", line
54, in ensure_defaults
raise ConnectionDoesNotExist("The connection %s doesn't exist" %
alias)
ConnectionDoesNotExist: The connection other doesn't exist

======================================================================
ERROR: Objects created on the default database don't leak onto other
databases
----------------------------------------------------------------------
Traceback (most recent call last):
File
"/home/jtiai/src/django/multidb/tests/regressiontests/multiple_database/tests.py",
line 34, in test_default_creation
Book.objects.get(title="Pro Django")
File "/home/jtiai/src/django/multidb/django/db/models/manager.py",
line 119, in get
return self.get_query_set().get(*args, **kwargs)
File "/home/jtiai/src/django/multidb/django/db/models/query.py",
line 307, in get
% (self.model._meta.object_name, num, kwargs))
MultipleObjectsReturned: get() returned more than one Book -- it
returned 2! Lookup parameters were {'title': 'Pro Django'}

======================================================================
ERROR: Operations that involve sharing FK objects across databases
raise an error
----------------------------------------------------------------------
Traceback (most recent call last):
File
"/home/jtiai/src/django/multidb/tests/regressiontests/multiple_database/tests.py",
line 391, in test_foreign_key_cross_database_protection
published=datetime.date(2009, 5, 4))
File "/home/jtiai/src/django/multidb/django/db/models/query.py",
line 315, in create
obj.save(force_insert=True, using=self.db)
File "/home/jtiai/src/django/multidb/django/db/models/base.py",
line 429, in save
self.save_base(using=using, force_insert=force_insert,
force_update=force_update)
File "/home/jtiai/src/django/multidb/django/db/models/base.py",
line 442, in save_base
connection = connections[using]
File "/home/jtiai/src/django/multidb/django/db/utils.py", line
68, in __getitem__
self.ensure_defaults(alias)
File "/home/jtiai/src/django/multidb/django/db/utils.py", line
54, in ensure_defaults
raise ConnectionDoesNotExist("The connection %s doesn't exist" %
alias)
ConnectionDoesNotExist: The connection other doesn't exist

======================================================================
ERROR: FK reverse manipulations are all constrained to a single DB
----------------------------------------------------------------------
Traceback (most recent call last):
File
"/home/jtiai/src/django/multidb/tests/regressiontests/multiple_database/tests.py",
line 292, in test_foreign_key_reverse_operations
published=datetime.date(2009, 5, 4))
File "/home/jtiai/src/django/multidb/django/db/models/query.py",
line 315, in create
obj.save(force_insert=True, using=self.db)
File "/home/jtiai/src/django/multidb/django/db/models/base.py",
line 429, in save
self.save_base(using=using, force_insert=force_insert,
force_update=force_update)
File "/home/jtiai/src/django/multidb/django/db/models/base.py",
line 442, in save_base
connection = connections[using]
File "/home/jtiai/src/django/multidb/django/db/utils.py", line
68, in __getitem__
self.ensure_defaults(alias)
File "/home/jtiai/src/django/multidb/django/db/utils.py", line
54, in ensure_defaults
raise ConnectionDoesNotExist("The connection %s doesn't exist" %
alias)
ConnectionDoesNotExist: The connection other doesn't exist

======================================================================
ERROR: FK fields are constrained to a single database
----------------------------------------------------------------------
Traceback (most recent call last):
File
"/home/jtiai/src/django/multidb/tests/regressiontests/multiple_database/tests.py",
line 261, in test_foreign_key_separation
published=datetime.date(2009, 5, 4))
File "/home/jtiai/src/django/multidb/django/db/models/query.py",
line 315, in create
obj.save(force_insert=True, using=self.db)
File "/home/jtiai/src/django/multidb/django/db/models/base.py",
line 429, in save
self.save_base(using=using, force_insert=force_insert,
force_update=force_update)
File "/home/jtiai/src/django/multidb/django/db/models/base.py",
line 442, in save_base
connection = connections[using]
File "/home/jtiai/src/django/multidb/django/db/utils.py", line
68, in __getitem__
self.ensure_defaults(alias)
File "/home/jtiai/src/django/multidb/django/db/utils.py", line
54, in ensure_defaults
raise ConnectionDoesNotExist("The connection %s doesn't exist" %
alias)
ConnectionDoesNotExist: The connection other doesn't exist

======================================================================
ERROR: Operations that involve sharing M2M objects across databases
raise an error
----------------------------------------------------------------------
Traceback (most recent call last):
File
"/home/jtiai/src/django/multidb/tests/regressiontests/multiple_database/tests.py",
line 343, in test_m2m_cross_database_protection
published=datetime.date(2009, 5, 4))
File "/home/jtiai/src/django/multidb/django/db/models/query.py",
line 315, in create
obj.save(force_insert=True, using=self.db)
File "/home/jtiai/src/django/multidb/django/db/models/base.py",
line 429, in save
self.save_base(using=using, force_insert=force_insert,
force_update=force_update)
File "/home/jtiai/src/django/multidb/django/db/models/base.py",
line 442, in save_base
connection = connections[using]
File "/home/jtiai/src/django/multidb/django/db/utils.py", line
68, in __getitem__
self.ensure_defaults(alias)
File "/home/jtiai/src/django/multidb/django/db/utils.py", line
54, in ensure_defaults
raise ConnectionDoesNotExist("The connection %s doesn't exist" %
alias)
ConnectionDoesNotExist: The connection other doesn't exist

======================================================================
ERROR: M2M forward manipulations are all constrained to a single DB
----------------------------------------------------------------------
Traceback (most recent call last):
File
"/home/jtiai/src/django/multidb/tests/regressiontests/multiple_database/tests.py",
line 167, in test_m2m_forward_operations
published=datetime.date(2009, 5, 4))
File "/home/jtiai/src/django/multidb/django/db/models/query.py",
line 315, in create
obj.save(force_insert=True, using=self.db)
File "/home/jtiai/src/django/multidb/django/db/models/base.py",
line 429, in save
self.save_base(using=using, force_insert=force_insert,
force_update=force_update)
File "/home/jtiai/src/django/multidb/django/db/models/base.py",
line 442, in save_base
connection = connections[using]
File "/home/jtiai/src/django/multidb/django/db/utils.py", line
68, in __getitem__
self.ensure_defaults(alias)
File "/home/jtiai/src/django/multidb/django/db/utils.py", line
54, in ensure_defaults
raise ConnectionDoesNotExist("The connection %s doesn't exist" %
alias)
ConnectionDoesNotExist: The connection other doesn't exist

======================================================================
ERROR: M2M reverse manipulations are all constrained to a single DB
----------------------------------------------------------------------
Traceback (most recent call last):
File
"/home/jtiai/src/django/multidb/tests/regressiontests/multiple_database/tests.py",
line 211, in test_m2m_reverse_operations
published=datetime.date(2009, 5, 4))
File "/home/jtiai/src/django/multidb/django/db/models/query.py",
line 315, in create
obj.save(force_insert=True, using=self.db)
File "/home/jtiai/src/django/multidb/django/db/models/base.py",
line 429, in save
self.save_base(using=using, force_insert=force_insert,
force_update=force_update)
File "/home/jtiai/src/django/multidb/django/db/models/base.py",
line 442, in save_base
connection = connections[using]
File "/home/jtiai/src/django/multidb/django/db/utils.py", line
68, in __getitem__
self.ensure_defaults(alias)
File "/home/jtiai/src/django/multidb/django/db/utils.py", line
54, in ensure_defaults
raise ConnectionDoesNotExist("The connection %s doesn't exist" %
alias)
ConnectionDoesNotExist: The connection other doesn't exist

======================================================================
ERROR: M2M fields are constrained to a single database
----------------------------------------------------------------------
Traceback (most recent call last):
File
"/home/jtiai/src/django/multidb/tests/regressiontests/multiple_database/tests.py",
line 139, in test_m2m_separation
published=datetime.date(2009, 5, 4))
File "/home/jtiai/src/django/multidb/django/db/models/query.py",
line 315, in create
obj.save(force_insert=True, using=self.db)
File "/home/jtiai/src/django/multidb/django/db/models/base.py",
line 429, in save
self.save_base(using=using, force_insert=force_insert,
force_update=force_update)
File "/home/jtiai/src/django/multidb/django/db/models/base.py",
line 442, in save_base
connection = connections[using]
File "/home/jtiai/src/django/multidb/django/db/utils.py", line
68, in __getitem__
self.ensure_defaults(alias)
File "/home/jtiai/src/django/multidb/django/db/utils.py", line
54, in ensure_defaults
raise ConnectionDoesNotExist("The connection %s doesn't exist" %
alias)
ConnectionDoesNotExist: The connection other doesn't exist

======================================================================
ERROR: Objects created on another database don't leak onto the default
database
----------------------------------------------------------------------
Traceback (most recent call last):
File
"/home/jtiai/src/django/multidb/tests/regressiontests/multiple_database/tests.py",
line 60, in test_other_creation
published=datetime.date(2008, 12, 16))
File "/home/jtiai/src/django/multidb/django/db/models/query.py",
line 315, in create
obj.save(force_insert=True, using=self.db)
File "/home/jtiai/src/django/multidb/django/db/models/base.py",
line 429, in save
self.save_base(using=using, force_insert=force_insert,
force_update=force_update)
File "/home/jtiai/src/django/multidb/django/db/models/base.py",
line 442, in save_base
connection = connections[using]
File "/home/jtiai/src/django/multidb/django/db/utils.py", line
68, in __getitem__
self.ensure_defaults(alias)
File "/home/jtiai/src/django/multidb/django/db/utils.py", line
54, in ensure_defaults
raise ConnectionDoesNotExist("The connection %s doesn't exist" %
alias)
ConnectionDoesNotExist: The connection other doesn't exist

======================================================================
FAIL: Doctest: django.contrib.auth.tests.__test__.BASIC_TESTS
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/jtiai/src/django/multidb/django/test/_doctest.py",
line 2180, in runTest
raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for
django.contrib.auth.tests.__test__.BASIC_TESTS
File
"/home/jtiai/src/django/multidb/django/contrib/auth/tests/__init__.py",
line unknown line number, in BASIC_TESTS

----------------------------------------------------------------------
File
"/home/jtiai/src/django/multidb/django/contrib/auth/tests/__init__.py",
line ?, in django.contrib.auth.tests.__test__.BASIC_TESTS
Failed example:
super = User.objects.create_superuser('super', 'su...@example.com',
'super')
Exception raised:
Traceback (most recent call last):
File "/home/jtiai/src/django/multidb/django/test/_doctest.py",
line 1267, in __run
compileflags, 1) in test.globs
File "<doctest
django.contrib.auth.tests.__test__.BASIC_TESTS[22]>", line 1, in
<module>
super = User.objects.create_superuser('super',
'su...@example.com', 'super')
File
"/home/jtiai/src/django/multidb/django/contrib/auth/models.py",
line 109, in create_superuser
u = self.create_user(username, email, password)
File
"/home/jtiai/src/django/multidb/django/contrib/auth/models.py",
line 105, in create_user
user.save()
File "/home/jtiai/src/django/multidb/django/db/models/base.py",
line 429, in save
self.save_base(using=using, force_insert=force_insert,
force_update=force_update)
File "/home/jtiai/src/django/multidb/django/db/models/base.py",
line 518, in save_base
result = manager._insert(values, return_id=update_pk,
using=using)
File "/home/jtiai/src/django/multidb/django/db/models/manager.py",
line 182, in _insert
return insert_query(self.model, values, **kwargs)
File "/home/jtiai/src/django/multidb/django/db/models/query.py",
line 1128, in insert_query
return compiler.execute_sql(return_id)
File
"/home/jtiai/src/django/multidb/django/db/models/sql/compiler.py",
line 711, in execute_sql
cursor = super(SQLInsertCompiler, self).execute_sql(None)
File
"/home/jtiai/src/django/multidb/django/db/models/sql/compiler.py",
line 667, in execute_sql
cursor.execute(sql, params)
File
"/home/jtiai/src/django/multidb/django/db/backends/oracle/base.py",
line 487, in execute
raise e
IntegrityError: ORA-00001: unique constraint
(TEST_DJANGO_TESTER.SYS_C009895) violated

----------------------------------------------------------------------
File
"/home/jtiai/src/django/multidb/django/contrib/auth/tests/__init__.py",
line ?, in django.contrib.auth.tests.__test__.BASIC_TESTS
Failed example:
super.is_superuser
Exception raised:
Traceback (most recent call last):
File "/home/jtiai/src/django/multidb/django/test/_doctest.py",
line 1267, in __run
compileflags, 1) in test.globs
File "<doctest
django.contrib.auth.tests.__test__.BASIC_TESTS[23]>", line 1, in
<module>
super.is_superuser
AttributeError: type object 'super' has no attribute 'is_superuser'
----------------------------------------------------------------------
File
"/home/jtiai/src/django/multidb/django/contrib/auth/tests/__init__.py",
line ?, in django.contrib.auth.tests.__test__.BASIC_TESTS
Failed example:
super.is_active
Exception raised:
Traceback (most recent call last):
File "/home/jtiai/src/django/multidb/django/test/_doctest.py",
line 1267, in __run
compileflags, 1) in test.globs
File "<doctest
django.contrib.auth.tests.__test__.BASIC_TESTS[24]>", line 1, in
<module>
super.is_active
AttributeError: type object 'super' has no attribute 'is_active'
----------------------------------------------------------------------
File
"/home/jtiai/src/django/multidb/django/contrib/auth/tests/__init__.py",
line ?, in django.contrib.auth.tests.__test__.BASIC_TESTS
Failed example:
super.is_staff
Exception raised:
Traceback (most recent call last):
File "/home/jtiai/src/django/multidb/django/test/_doctest.py",
line 1267, in __run
compileflags, 1) in test.globs
File "<doctest
django.contrib.auth.tests.__test__.BASIC_TESTS[25]>", line 1, in
<module>
super.is_staff
AttributeError: type object 'super' has no attribute 'is_staff'


======================================================================
FAIL: Doctest: modeltests.basic.models.__test__.API_TESTS
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/jtiai/src/django/multidb/django/test/_doctest.py",
line 2180, in runTest
raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for
modeltests.basic.models.__test__.API_TESTS
File
"/home/jtiai/src/django/multidb/tests/modeltests/basic/models.py",
line unknown line number, in API_TESTS

----------------------------------------------------------------------
File "/home/jtiai/src/django/multidb/tests/modeltests/basic/models.py",
line ?, in modeltests.basic.models.__test__.API_TESTS
Failed example:
Article.objects.get(pk=a.id).headline
Expected:
u'\u6797\u539f \u3081\u3050\u307f'
Got:
u'\xbf\xbf \xbf\xbf\xbf'


======================================================================
FAIL: Doctest: regressiontests.queries.models.__test__.API_TESTS
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/jtiai/src/django/multidb/django/test/_doctest.py",
line 2180, in runTest
raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for
regressiontests.queries.models.__test__.API_TESTS
File
"/home/jtiai/src/django/multidb/tests/regressiontests/queries/models.py",
line unknown line number, in API_TESTS

----------------------------------------------------------------------
File
"/home/jtiai/src/django/multidb/tests/regressiontests/queries/models.py",
line ?, in regressiontests.queries.models.__test__.API_TESTS
Failed example:
Report.objects.values_list("creator__extra__info",
flat=True).order_by("name")
Expected:
[u'e1', u'e2', None]
Got:
[u'e1', u'e2', u'']


======================================================================
FAIL: test_json_serializer
(regressiontests.serializers_regress.tests.SerializerTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/jtiai/src/django/multidb/django/utils/functional.py",
line 55, in _curried
return _curried_func(*(args+moreargs), **dict(kwargs, **morekwargs))
File
"/home/jtiai/src/django/multidb/tests/regressiontests/serializers_regress/tests.py",
line 396, in serializerTest
func[1](self, pk, klass, datum)
File
"/home/jtiai/src/django/multidb/tests/regressiontests/serializers_regress/tests.py",
line 101, in data_compare
"Objects with PK=%d not equal; expected '%s' (%s), got '%s' (%s)"
% (pk,data, type(data), instance.data, type(instance.data)))
AssertionError: Objects with PK=15 not equal; expected 'None' (<type
'NoneType'>), got '' (<type 'unicode'>)

======================================================================
FAIL: test_python_serializer
(regressiontests.serializers_regress.tests.SerializerTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/jtiai/src/django/multidb/django/utils/functional.py",
line 55, in _curried
return _curried_func(*(args+moreargs), **dict(kwargs, **morekwargs))
File
"/home/jtiai/src/django/multidb/tests/regressiontests/serializers_regress/tests.py",
line 396, in serializerTest
func[1](self, pk, klass, datum)
File
"/home/jtiai/src/django/multidb/tests/regressiontests/serializers_regress/tests.py",
line 101, in data_compare
"Objects with PK=%d not equal; expected '%s' (%s), got '%s' (%s)"
% (pk,data, type(data), instance.data, type(instance.data)))
AssertionError: Objects with PK=15 not equal; expected 'None' (<type
'NoneType'>), got '' (<type 'unicode'>)

======================================================================
FAIL: test_xml_serializer
(regressiontests.serializers_regress.tests.SerializerTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/jtiai/src/django/multidb/django/utils/functional.py",
line 55, in _curried
return _curried_func(*(args+moreargs), **dict(kwargs, **morekwargs))
File
"/home/jtiai/src/django/multidb/tests/regressiontests/serializers_regress/tests.py",
line 396, in serializerTest
func[1](self, pk, klass, datum)
File
"/home/jtiai/src/django/multidb/tests/regressiontests/serializers_regress/tests.py",
line 101, in data_compare
"Objects with PK=%d not equal; expected '%s' (%s), got '%s' (%s)"
% (pk,data, type(data), instance.data, type(instance.data)))
AssertionError: Objects with PK=15 not equal; expected 'None' (<type
'NoneType'>), got '' (<type 'unicode'>)

======================================================================
FAIL: Doctest:
regressiontests.fixtures_regress.models.__test__.API_TESTS
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/jtiai/src/django/multidb/django/test/_doctest.py",
line 2180, in runTest
raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for
regressiontests.fixtures_regress.models.__test__.API_TESTS
File
"/home/jtiai/src/django/multidb/tests/regressiontests/fixtures_regress/models.py",
line unknown line number, in API_TESTS

----------------------------------------------------------------------
File
"/home/jtiai/src/django/multidb/tests/regressiontests/fixtures_regress/models.py",
line ?, in regressiontests.fixtures_regress.models.__test__.API_TESTS
Failed example:
Stuff.objects.all()
Expected:
[<Stuff: None is owned by None>]
Got:
[<Stuff: is owned by None>]


======================================================================
FAIL: Doctest: regressiontests.model_regress.models.__test__.API_TESTS
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/jtiai/src/django/multidb/django/test/_doctest.py",
line 2180, in runTest
raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for
regressiontests.model_regress.models.__test__.API_TESTS
File
"/home/jtiai/src/django/multidb/tests/regressiontests/model_regress/models.py",
line unknown line number, in API_TESTS

----------------------------------------------------------------------
File
"/home/jtiai/src/django/multidb/tests/regressiontests/model_regress/models.py",
line ?, in regressiontests.model_regress.models.__test__.API_TESTS
Failed example:
BrokenUnicodeMethod.objects.all()
Expected:
[<BrokenUnicodeMethod: [Bad Unicode data]>]
Got:
[<BrokenUnicodeMethod: Názov: Jerry>]


======================================================================
FAIL: Doctest:
regressiontests.model_regress.models.__test__.timezone-tests
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/jtiai/src/django/multidb/django/test/_doctest.py",
line 2180, in runTest
raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for
regressiontests.model_regress.models.__test__.timezone-tests
File
"/home/jtiai/src/django/multidb/tests/regressiontests/model_regress/models.py",
line unknown line number, in timezone-tests

----------------------------------------------------------------------
File
"/home/jtiai/src/django/multidb/tests/regressiontests/model_regress/models.py",
line ?, in regressiontests.model_regress.models.__test__.timezone-tests
Failed example:
obj = Article.objects.create(headline="A headline", pub_date=dt1,
article_text="foo")
Exception raised:
Traceback (most recent call last):
File "/home/jtiai/src/django/multidb/django/test/_doctest.py",
line 1267, in __run
compileflags, 1) in test.globs
File "<doctest
regressiontests.model_regress.models.__test__.timezone-tests[3]>",
line 1, in <module>
File "/home/jtiai/src/django/multidb/django/db/models/manager.py",
line 125, in create
return self.get_query_set().create(**kwargs)
File "/home/jtiai/src/django/multidb/django/db/models/query.py",
line 315, in create
obj.save(force_insert=True, using=self.db)
File "/home/jtiai/src/django/multidb/django/db/models/base.py",
line 429, in save
self.save_base(using=using, force_insert=force_insert,
force_update=force_update)
File "/home/jtiai/src/django/multidb/django/db/models/base.py",
line 518, in save_base
result = manager._insert(values, return_id=update_pk,
using=using)
File "/home/jtiai/src/django/multidb/django/db/models/manager.py",
line 182, in _insert
return insert_query(self.model, values, **kwargs)
File "/home/jtiai/src/django/multidb/django/db/models/query.py",
line 1128, in insert_query
return compiler.execute_sql(return_id)
File
"/home/jtiai/src/django/multidb/django/db/models/sql/compiler.py",
line 711, in execute_sql
cursor = super(SQLInsertCompiler, self).execute_sql(None)
File
"/home/jtiai/src/django/multidb/django/db/models/sql/compiler.py",
line 667, in execute_sql
cursor.execute(sql, params)
File
"/home/jtiai/src/django/multidb/django/db/backends/oracle/base.py",
line 487, in execute
raise e
DatabaseError: ORA-01830: date format picture ends before
converting entire input string

----------------------------------------------------------------------
File
"/home/jtiai/src/django/multidb/tests/regressiontests/model_regress/models.py",
line ?, in regressiontests.model_regress.models.__test__.timezone-tests
Failed example:
obj.pub_date = dt2
Exception raised:
Traceback (most recent call last):
File "/home/jtiai/src/django/multidb/django/test/_doctest.py",
line 1267, in __run
compileflags, 1) in test.globs
File "<doctest
regressiontests.model_regress.models.__test__.timezone-tests[4]>",
line 1, in <module>
NameError: name 'obj' is not defined
----------------------------------------------------------------------
File
"/home/jtiai/src/django/multidb/tests/regressiontests/model_regress/models.py",
line ?, in regressiontests.model_regress.models.__test__.timezone-tests
Failed example:
obj.save()
Exception raised:
Traceback (most recent call last):
File "/home/jtiai/src/django/multidb/django/test/_doctest.py",
line 1267, in __run
compileflags, 1) in test.globs
File "<doctest
regressiontests.model_regress.models.__test__.timezone-tests[5]>",
line 1, in <module>
NameError: name 'obj' is not defined
----------------------------------------------------------------------
File
"/home/jtiai/src/django/multidb/tests/regressiontests/model_regress/models.py",
line ?, in regressiontests.model_regress.models.__test__.timezone-tests
Failed example:
Article.objects.filter(headline="A headline").update(pub_date=dt1)
Expected:
1
Got:
0


======================================================================
FAIL: Doctest:
regressiontests.expressions_regress.models.__test__.API_TESTS
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/jtiai/src/django/multidb/django/test/_doctest.py",
line 2180, in runTest
raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for
regressiontests.expressions_regress.models.__test__.API_TESTS
File
"/home/jtiai/src/django/multidb/tests/regressiontests/expressions_regress/models.py",
line unknown line number, in API_TESTS

----------------------------------------------------------------------
File
"/home/jtiai/src/django/multidb/tests/regressiontests/expressions_regress/models.py",
line ?, in regressiontests.expressions_regress.models.__test__.API_TESTS
Failed example:
_ = Number.objects.filter(pk=n.pk).update(integer=F('integer') | 48)
Exception raised:
Traceback (most recent call last):
File "/home/jtiai/src/django/multidb/django/test/_doctest.py",
line 1267, in __run
compileflags, 1) in test.globs
File "<doctest
regressiontests.expressions_regress.models.__test__.API_TESTS[50]>",
line 1, in <module>
_ = Number.objects.filter(pk=n.pk).update(integer=F('integer') |
48)
File "/home/jtiai/src/django/multidb/django/db/models/query.py",
line 420, in update
rows = query.get_compiler(self.db).execute_sql(None)
File
"/home/jtiai/src/django/multidb/django/db/models/sql/compiler.py",
line 789, in execute_sql
cursor = super(SQLUpdateCompiler, self).execute_sql(result_type)
File
"/home/jtiai/src/django/multidb/django/db/models/sql/compiler.py",
line 657, in execute_sql
sql, params = self.as_sql()
File
"/home/jtiai/src/django/multidb/django/db/models/sql/compiler.py",
line 766, in as_sql
sql, params = val.as_sql(qn, self.connection)
File
"/home/jtiai/src/django/multidb/django/db/models/sql/expressions.py",
line 15, in as_sql
return self.expression.evaluate(self, qn, connection)
File
"/home/jtiai/src/django/multidb/django/db/models/expressions.py",
line 45, in evaluate
return evaluator.evaluate_node(self, qn, connection)
File
"/home/jtiai/src/django/multidb/django/db/models/sql/expressions.py",
line 74, in evaluate_node
return connection.ops.combine_expression(node.connector,
expressions), expression_params
File
"/home/jtiai/src/django/multidb/django/db/backends/oracle/base.py",
line 308, in combine_expression
raise NotImplementedError("Bit-wise or is not supported in
Oracle.")
NotImplementedError: Bit-wise or is not supported in Oracle.
----------------------------------------------------------------------
File
"/home/jtiai/src/django/multidb/tests/regressiontests/expressions_regress/models.py",
line ?, in regressiontests.expressions_regress.models.__test__.API_TESTS
Failed example:
Number.objects.get(pk=n.pk) # LH Bitwise or on integers
Expected:
<Number: 58, 15.500>
Got:
<Number: 42, 15.500>
----------------------------------------------------------------------
File
"/home/jtiai/src/django/multidb/tests/regressiontests/expressions_regress/models.py",
line ?, in regressiontests.expressions_regress.models.__test__.API_TESTS
Failed example:
_ = Number.objects.filter(pk=n.pk).update(integer=15 | F('integer'))
Exception raised:
Traceback (most recent call last):
File "/home/jtiai/src/django/multidb/django/test/_doctest.py",
line 1267, in __run
compileflags, 1) in test.globs
File "<doctest
regressiontests.expressions_regress.models.__test__.API_TESTS[53]>",
line 1, in <module>
_ = Number.objects.filter(pk=n.pk).update(integer=15 |
F('integer'))
File "/home/jtiai/src/django/multidb/django/db/models/query.py",
line 420, in update
rows = query.get_compiler(self.db).execute_sql(None)
File
"/home/jtiai/src/django/multidb/django/db/models/sql/compiler.py",
line 789, in execute_sql
cursor = super(SQLUpdateCompiler, self).execute_sql(result_type)
File
"/home/jtiai/src/django/multidb/django/db/models/sql/compiler.py",
line 657, in execute_sql
sql, params = self.as_sql()
File
"/home/jtiai/src/django/multidb/django/db/models/sql/compiler.py",
line 766, in as_sql
sql, params = val.as_sql(qn, self.connection)
File
"/home/jtiai/src/django/multidb/django/db/models/sql/expressions.py",
line 15, in as_sql
return self.expression.evaluate(self, qn, connection)
File
"/home/jtiai/src/django/multidb/django/db/models/expressions.py",
line 45, in evaluate
return evaluator.evaluate_node(self, qn, connection)
File
"/home/jtiai/src/django/multidb/django/db/models/sql/expressions.py",
line 74, in evaluate_node
return connection.ops.combine_expression(node.connector,
expressions), expression_params
File
"/home/jtiai/src/django/multidb/django/db/backends/oracle/base.py",
line 308, in combine_expression
raise NotImplementedError("Bit-wise or is not supported in
Oracle.")
NotImplementedError: Bit-wise or is not supported in Oracle.
----------------------------------------------------------------------
File
"/home/jtiai/src/django/multidb/tests/regressiontests/expressions_regress/models.py",
line ?, in regressiontests.expressions_regress.models.__test__.API_TESTS
Failed example:
Number.objects.get(pk=n.pk) # RH Bitwise or on integers
Expected:
<Number: 47, 15.500>
Got:
<Number: 42, 15.500>


----------------------------------------------------------------------
Ran 982 tests in 3934.612s

FAILED (failures=10, errors=11)
Destroying test database 'default'...
Destroying test user...
Destroying test database tables...


Alex Gaynor

unread,
Nov 26, 2009, 2:28:43 AM11/26/09
to django-d...@googlegroups.com
> --
>
> You received this message because you are subscribed to the Google Groups "Django developers" group.
> To post to this group, send email to django-d...@googlegroups.com.
> To unsubscribe from this group, send email to django-develop...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/django-developers?hl=en.
>
>
>

Thanks for taking the time to run all of those! All of those
ConnectionDoesNotExist errors come from the fact that the multidb
tests expect you to have more than 1 DB set up in your settings file,
the rigth solution here is probably to just fail right away, instead
of attempting to run each individual test which can produce some
confusing failures. As for the other errors I'm not sure what's a
consequence of my work, and what's an existing condition. If you
could run the trunk tests (with your modification for memory) and see
what the result is that would be awesome. Any new errors are
obviously regressions and should be fixed.

Jani Tiainen

unread,
Nov 26, 2009, 2:42:07 AM11/26/09
to django-d...@googlegroups.com
On Thu, 2009-11-26 at 01:28 -0600, Alex Gaynor wrote:

>
> Thanks for taking the time to run all of those! All of those
> ConnectionDoesNotExist errors come from the fact that the multidb
> tests expect you to have more than 1 DB set up in your settings file,
> the rigth solution here is probably to just fail right away, instead
> of attempting to run each individual test which can produce some
> confusing failures. As for the other errors I'm not sure what's a
> consequence of my work, and what's an existing condition. If you
> could run the trunk tests (with your modification for memory) and see
> what the result is that would be awesome. Any new errors are
> obviously regressions and should be fixed.
>
> Alex
>

I didn't have to run anything, that what computers are for..? :)

Could you provide sample DATABASES connection definition for multidb
tests so I could rerun all that fancy stuff correctly.

--

Jani Tiainen



Alex Gaynor

unread,
Nov 26, 2009, 2:44:16 AM11/26/09
to django-d...@googlegroups.com
> --
>
> You received this message because you are subscribed to the Google Groups "Django developers" group.
> To post to this group, send email to django-d...@googlegroups.com.
> To unsubscribe from this group, send email to django-develop...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/django-developers?hl=en.
>
>
>

DATABASES = {
"default": {
# your settings here
},
"other": {
"ENGINE": "sqlite3",
"NAME": ":memory:",
}
}

Is all you need (don't bother rerunning all of the tests with these
settings, the only ones affected are the multiple_database ones).

Jani Tiainen

unread,
Nov 26, 2009, 4:03:48 AM11/26/09
to django-d...@googlegroups.com
======================================================================
ERROR: Objects created on the default database don't leak onto other
databases
----------------------------------------------------------------------
Traceback (most recent call last):
File
"/home/KEYPRO/jtiai/src/multidb/tests/regressiontests/multiple_database/tests.py", line 34, in test_default_creation
Book.objects.get(title="Pro Django")
File "/home/KEYPRO/jtiai/src/multidb/django/db/models/manager.py",
line 119, in get
return self.get_query_set().get(*args, **kwargs)
File "/home/KEYPRO/jtiai/src/multidb/django/db/models/query.py", line
307, in get
% (self.model._meta.object_name, num, kwargs))
MultipleObjectsReturned: get() returned more than one Book -- it
returned 2! Lookup parameters were {'title': 'Pro Django'}

======================================================================
FAIL: Queries are constrained to a single database
----------------------------------------------------------------------
Traceback (most recent call last):
File
"/home/KEYPRO/jtiai/src/multidb/tests/regressiontests/multiple_database/tests.py", line 117, in test_basic_queries
self.assertRaises(Book.DoesNotExist,
Book.objects.using('default').get, published__year=2009)
AssertionError: DoesNotExist not raised

======================================================================
FAIL: Objects created on another database don't leak onto the default
database
----------------------------------------------------------------------
Traceback (most recent call last):
File
"/home/KEYPRO/jtiai/src/multidb/tests/regressiontests/multiple_database/tests.py", line 76, in test_other_creation
title="Pro Django"
AssertionError: DoesNotExist not raised

----------------------------------------------------------------------
Ran 12 tests in 2.778s

Well that's all for multiple_database tests configured so that "default"
points to my oracle and "other" points to sqlite3 memory database.


Russell Keith-Magee

unread,
Nov 26, 2009, 7:23:59 AM11/26/09
to django-d...@googlegroups.com
Thanks for that Jani. These errors are extremely unusual - it appears
as if the test cases aren't correctly flushing the database at the
start of the test run.

For example - the ERROR on line 34 of the test case tests that a
single instance of a book has been created on the default database,
but two instances are found.However, there should only be 1 book in
the database at that point.

I can't think of any reason this would be happening, though. To help
track this down a bit:

* Do you get the same failures if you run those tests in isolation? i.e.,

./runtests --settings=oracle
multiple_databases.QueryTestCase.test_default_creation

./runtests --settings=oracle
multiple_databases.QueryTestCase.test_other_creation

./runtests --settings=oracle multiple_databases.QueryTestCase.test_basic_queries

* Do you still get the same failures if you run with a file-backed
SQLite instance, rather than an in-memory instance? (change ':memory:'
to 'other_db' in your settings file)

* Do you still get the same failures if you convert QueryTestCase into
a TransactionTestCase (i.e., change the import "from django.test
import TestCase" to "from django.test import TransactionTestCase as
TestCase")

* Could you please add:

self.assertEquals(Book.objects.count(), 0)
self.assertEquals(Book.objects.using('default').count(), 0)
self.assertEquals(Book.objects.using('other').count(), 0)

to the start of test_default_creation (line 20 of
tests/regressiontests/multiple_databases/tests.py), and report if
these assertions pass when the entire multiple_databases suite is run,
and when the test_default_creation test is run in isolation.

Any other poking around or investigation notes you can offer here
would be most welcome.

Many thanks for taking the time to help out here.

Yours,
Russ Magee %-)

Jani Tiainen

unread,
Nov 26, 2009, 8:37:03 AM11/26/09
to django-d...@googlegroups.com
Passed (with assertion additions, in memory sqlite)

> ./runtests --settings=oracle
> multiple_databases.QueryTestCase.test_other_creation

Passed.

> ./runtests --settings=oracle multiple_databases.QueryTestCase.test_basic_queries

Passed.

> * Do you still get the same failures if you run with a file-backed
> SQLite instance, rather than an in-memory instance? (change ':memory:'
> to 'other_db' in your settings file)

Yes.

> * Do you still get the same failures if you convert QueryTestCase into
> a TransactionTestCase (i.e., change the import "from django.test
> import TestCase" to "from django.test import TransactionTestCase as
> TestCase")

All three passed in isolated tests.

> * Could you please add:
>
> self.assertEquals(Book.objects.count(), 0)
> self.assertEquals(Book.objects.using('default').count(), 0)
> self.assertEquals(Book.objects.using('other').count(), 0)

Added these before any tests...

And full multiple_database tests with localfile sqlite3

Transactionals passed.

Without transactional tests full multiple_database tests:

======================================================================
FAIL: Queries are constrained to a single database
----------------------------------------------------------------------
Traceback (most recent call last):
File
"/home/KEYPRO/jtiai/src/multidb/tests/regressiontests/multiple_database/tests.py", line 122, in test_basic_queries
self.assertRaises(Book.DoesNotExist,
Book.objects.using('default').get, published__year=2009)
AssertionError: DoesNotExist not raised

======================================================================
FAIL: Objects created on the default database don't leak onto other
databases
----------------------------------------------------------------------
Traceback (most recent call last):
File
"/home/KEYPRO/jtiai/src/multidb/tests/regressiontests/multiple_database/tests.py", line 23, in test_default_creation
self.assertEquals(Book.objects.count(), 0)
AssertionError: 2 != 0

======================================================================
FAIL: Objects created on another database don't leak onto the default
database
----------------------------------------------------------------------
Traceback (most recent call last):
File
"/home/KEYPRO/jtiai/src/multidb/tests/regressiontests/multiple_database/tests.py", line 81, in test_other_creation
title="Pro Django"
AssertionError: DoesNotExist not raised



Hope that these helps to pinpoint problem.

--

Jani Tiainen


Russell Keith-Magee

unread,
Nov 26, 2009, 8:56:43 AM11/26/09
to django-d...@googlegroups.com
On Thu, Nov 26, 2009 at 9:37 PM, Jani Tiainen <red...@gmail.com> wrote:
> On Thu, 2009-11-26 at 20:23 +0800, Russell Keith-Magee wrote:
>
>> * Do you still get the same failures if you convert QueryTestCase into
>> a TransactionTestCase (i.e., change the import "from django.test
>> import TestCase" to "from django.test import TransactionTestCase as
>> TestCase")
>
> All three passed in isolated tests.

Do the TransactionTestCase versions still pass when you execute the
full multi-db suite? If so, I think we have narrowed the problem down
to the rollback code.

A few more debug data points:

* Could you please run the full multi-db suite with verbosity=2; it
would be helpful to see the exact order in which the tests are being
executed

* Could you run just the multiple_database.QueryTestCase test case
(again, with verbosity=2, so I can see the test order). I'm wondering
if the problem might be a leakage of fixture loading.

Thanks,
Russ %-)

Jani Tiainen

unread,
Nov 26, 2009, 9:56:10 AM11/26/09
to django-d...@googlegroups.com
On Thu, 2009-11-26 at 21:56 +0800, Russell Keith-Magee wrote:
> On Thu, Nov 26, 2009 at 9:37 PM, Jani Tiainen <red...@gmail.com> wrote:
> > On Thu, 2009-11-26 at 20:23 +0800, Russell Keith-Magee wrote:
> >
> >> * Do you still get the same failures if you convert QueryTestCase into
> >> a TransactionTestCase (i.e., change the import "from django.test
> >> import TestCase" to "from django.test import TransactionTestCase as
> >> TestCase")
> >
> > All three passed in isolated tests.
>
> Do the TransactionTestCase versions still pass when you execute the
> full multi-db suite? If so, I think we have narrowed the problem down
> to the rollback code.

Yes they pass.

I thought I wrote it down but I might have forgotten that one.

> A few more debug data points:
>
> * Could you please run the full multi-db suite with verbosity=2; it
> would be helpful to see the exact order in which the tests are being
> executed

testrun1.log

> * Could you run just the multiple_database.QueryTestCase test case
> (again, with verbosity=2, so I can see the test order). I'm wondering
> if the problem might be a leakage of fixture loading.
>

testrun2.log


Made those as attachments since theyu're so huge ones... HTH.

--

Jani Tiainen

testrun2.log
testrun1.log

Russell Keith-Magee

unread,
Nov 26, 2009, 10:38:09 AM11/26/09
to django-d...@googlegroups.com
Yes - this does help. The confirms my suspicion - the problem is that
the fixture loaded in FixtureTestCase.test_fixture_loading isn't being
cleared before running the tests in QueryTestCase.

The annoying thing is that I don't see this problem on any other
database, so there is something specific about transaction rollback on
Oracle. I can't see anything in that code that is should be
Oracle-specific behavior.

The magic code is in _fixture_teardown(), starting at line 487 of
django/tests/testcases.py. That method *should* be resetting the
database at the end of multiple_database.FixtureTestCase, but
evidently it isn't. Either the transaction rollback code isn't getting
invoked, or it is getting invoked but not behaving as expected.

Any debugging assistance you can provide here would be most welcome.

Yours
Russ Magee %-)

Ian Kelly

unread,
Nov 26, 2009, 10:44:53 AM11/26/09
to django-d...@googlegroups.com
On Thu, Nov 26, 2009 at 8:38 AM, Russell Keith-Magee
<freakb...@gmail.com> wrote:
> Yes - this does help. The confirms my suspicion - the problem is that
> the fixture loaded in FixtureTestCase.test_fixture_loading isn't being
> cleared before running the tests in QueryTestCase.
>
> The annoying thing is that I don't see this problem on any other
> database, so there is something specific about transaction rollback on
> Oracle. I can't see anything in that code that is should be
> Oracle-specific behavior.
>
> The magic code is in _fixture_teardown(), starting at line 487 of
> django/tests/testcases.py. That method *should* be resetting the
> database at the end of multiple_database.FixtureTestCase, but
> evidently it isn't. Either the transaction rollback code isn't getting
> invoked, or it is getting invoked but not behaving as expected.
>
> Any debugging assistance you can provide here would be most welcome.
>
> Yours
> Russ Magee %-)

It sounds like you're running into another case of #11101. The basic
problem is that loading fixtures involves resetting sequences, which
requires running DDL, which causes an implicit commit.

Ian

Jani Tiainen

unread,
Nov 26, 2009, 2:42:16 PM11/26/09
to django-d...@googlegroups.com
That must be it. Any DDL operation in Oracle does implicit commit before actually execting DDL. Very hard to get around since it's how DDL works in Oracle.

Russell Keith-Magee

unread,
Nov 26, 2009, 7:02:00 PM11/26/09
to django-d...@googlegroups.com
Looks like that explains it. Thanks for stepping in and saving my
sanity, Ian :-)

I've added a note to #11101 so that this bit of knowledge isn't forgotten.

Yours,
Russ Magee %-)
Reply all
Reply to author
Forward
0 new messages