[Zope-dev] Test runner: layers, subprocesses, and tear down

Chris Withers chris at simplistix.co.uk
Fri Jul 4 14:24:08 EDT 2008


Hi Benji,

I've read the whole thread to date but thought I'd reply here...

Benji York wrote:
> I'm working on making the zope.testing test runner run tests in
> parallelized subprocesses.  The option will likely be spelled -j N,
> where N is the maximum number of processes.

Cool :-)
But please defauult to 1 for backwards compatability...

> I'd like to 1) remove the layer tear-down mechanism entirely, and 2)
> make (almost) all layers run in a subprocess.

-lots to both of these I'm afraid.
I've used tear-downs extensively for everything from shutting database 
connections to aborting transactions to dumping DemoStorages. I'm sure 
I'm not the only one..

As for all layers in a sub-process, I worry that this would break 
existing tests in some kind of horrible nasty way...

> I want to do #1 because it would simplify the test runner code and no
> one seems to be using the functionality anyway.  It also appears from
> reading the code that any tests run in a subprocess (and most are) will
> never exercise the tear-down mechanism anyway.

So I guess we're not currently running tests in a sub-process?
My take on the pre-refactor testrunner was that a sub-process was only 
used when the testrunner was testing itself?

> #2 will add some process start-up overhead, but it'll only be one more
> process than is already started (and any reasonably-sized test corpus
> already starts several processes for each test run).  The one exception
> is for running with -D or with a pdb.set_trace() embedded in the code
> under test.  For that case we need a switch to say "don't start any
> subprocesses at all", I suspect that will be spelled -j0.

Right, I use this a lot. I guess -j0 should be the default for backwards 
compatability?

cheers,

Chris

-- 
Simplistix - Content Management, Zope & Python Consulting
            - http://www.simplistix.co.uk


More information about the Zope-Dev mailing list