Friday, January 15, 2010

Re: Postgres and "autocommit"

On Sat, Jan 16, 2010 at 1:38 AM, apramanik <abhikp@gmail.com> wrote:
> I turned autocommit on for our Django project and our unittests fail
> unless we put "transaction.rollback" in our tearDown. Any idea why?
> After fixing that I also noticed that our unittests are *much* slower.
> Is it because they're mainly doing deletes and writes (we also load in
> fixtures via YAML) and they don't get accumulated before being written
> to disk? Thanks!

Without having any details about your unit tests, it's impossible to
say for certain what is causing your slowdowns. However, a likely
cause is the difference between django.test.TestCase and
django.test.TransactionTestCase.

django.test.TestCase uses transactions internally to speed up the
testing process. However, if your tests rely on the use of
transactions, you may experience problems. See the docs on TestCase
and TransactionTestCase [1] for more details.

[1] http://docs.djangoproject.com/en/1.1/topics/testing/#testcase

Yours,
Russ Magee %-)

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate