[Zope-dev] zope.testing.runner: protecting against rogue threads

Christian Theune ct at gocept.com
Fri Apr 3 02:45:21 EDT 2009


On Thu, 2009-04-02 at 21:17 +0200, Dieter Maurer wrote:
> Christian Theune wrote at 2009-4-2 13:30 +0200:
> >if tests spawn non-daemon threads, then the test runner can get stuck.
> >
> >The easiest way that I see is to always --exit-with-status and to make
> >--exist-with-status also call sys.exit() when the tests passed.
> 
> I do not understand the implication.
> 
>   Do you plan that any test runs in a separate process?
> 
>   Then, I would have an objection -- test suites would take far longer.

No. What I meant was this:

- if non-daemon threads remain after the test runner is done and the
  main thread exits, the Python interpreter will not exit

- we already have the option "--exit-with-status" which will make the
  test runner always exit (even when non-daemon threads remain).
  However, --exit-with-status doesn't use sys.exit() in the case of a
  test success.

I don't want to change the process structure: I only want to assure that
the processes we start also quit.

Christian

-- 
Christian Theune · ct at gocept.com
gocept gmbh & co. kg · forsterstraße 29 · 06112 halle (saale) · germany
http://gocept.com · tel +49 345 1229889 7 · fax +49 345 1229889 1
Zope and Plone consulting and development
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
Url : http://mail.zope.org/pipermail/zope-dev/attachments/20090403/56554d76/attachment.bin 


More information about the Zope-Dev mailing list