← Back to team overview

launchpad-dev team mailing list archive

Re: performance tuesday... tests

 

On Sep 30, 2010, at 1:25 AM, Stuart Bishop wrote:

> On Wed, Sep 29, 2010 at 9:15 PM, Francis J. Lacoste
> <francis.lacoste@xxxxxxxxxxxxx> wrote:
>> Hi Robert,
>> 
>> On September 28, 2010, Robert Collins wrote:
>>> Several ways, firstly layers, by supporting setup-only fixtures add
>>> about 30-40 seconds per test run for every layer that we have that
>>> can't be torn down. Secondly, because layers are so fragile, our test
>>> fixtures do redundant work on setup - they have code to shutdown
>>> failed-to-shutdown instances that can spin for up to 5 seconds (by
>>> default).
>> 
>> Unless I'm mistaken the only layer that can't be currently torn down is the
>> FunctionalLayer that loads the ZCML. And I remember Gary telling me that
>> recent zope libraries (that we are using) now support unloading the zope
>> component registry. So in theory, we could make all our layers support tear
>> down.
> 
> But the really interesting thing is that I think the only reason we
> had to go with layers was that it handled resources that couldn't be
> torn down.

Yes, I wasn't here at the time, but that sounds right.

> If the CA teardown works reliably and as expected, I don't
> see anything else tying us to layers.

I would be surprised if our use of layers has not polluted our tests such that, even if the Zope teardown machinery were perfect, getting rid of layers would be simple.  However, it sure would be nice, yes.

The zope.component code registers clean up mechanisms with zope.testing.cleanup, which we probably are already using.  It cleans up the component registry every time it is called.

Gary


References