[Zope3-dev] Re: testing and savepoints
Tres Seaver
tseaver at palladion.com
Tue Oct 17 13:46:14 EDT 2006
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Chris Withers wrote:
> Hi all,
>
> (sorry if some of this is Zope 2 - ish, the thread kinda started here
> and the underlying bits of this are certainly relevant to Zope 3)
>
> As you may have guessed by the flurry of mails today, I've been
> refactoring a 2000 test suite to use layers.
>
> I was hoping to use savepoints to speed things up...
>
> Each layer drops a savepoint in setUp and then rolls it back it in
> tearDown. Likewise, the TestCase's setUp would drop a savepoint and the
> tearDown would roll back to it.
>
> Sounds great, no?
>
> Well, no, actually:
>
> 1. Usual problems of some datamanagers not supporting savepoints.
> MaildropHost and some of the project's own products datamanagers do.
> mxODBC does not :-/
>
> 2. dropping savepoints is slow. Figuring this might be due to saving
> data from the layer each time transaction.savepoint() is called, I
> thought of getting round this by dropping a savepoint at the end of the
> layer's setUp method. This did make thing a litte better, but:
>
> 3. savepoints are really slow :-(
>
> What's the usecase for savepoints? I would have thought this kind of
> thing would be ideal, but they seem really slow...
>
> For example, the above test suite takes about 300s to run prior to
> introducing layers.
>
> Using savepoints in place of transaction.commit()'s meant it took over
> 400s! :-(
>
> So I'm left what the actual use for savepoints is and if they could be
> made any faster?
Dunno, but this question belongs on zodb-dev.
Tres.
- --
===================================================================
Tres Seaver +1 202-558-7113 tseaver at palladion.com
Palladion Software "Excellence by Design" http://palladion.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFFNRbm+gerLs4ltQ4RArYgAJ9NYbG6fk3dL2D554JYkr1WxX17IgCg1UKU
2r+I33mqdDRHaUWTPKyvXfc=
=h1Tg
-----END PGP SIGNATURE-----
More information about the Zope3-dev
mailing list