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

2009-04-05 Thread Dieter Maurer
Christian Theune wrote at 2009-4-3 08:45 +0200:
 ...
I don't want to change the process structure: I only want to assure that
the processes we start also quit.

Then no objection from me.



-- 
Dieter
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


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

2009-04-03 Thread Christian Theune
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 · c...@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


signature.asc
Description: This is a digitally signed message part
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


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

2009-04-02 Thread Christian Theune
On Thu, 2009-04-02 at 13:30 +0200, Christian Theune wrote:
 Hi,
 
 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.
 
 Any objections?

I forgot an alternative solution:

Make the test runner patch the Thread class to turn all threads into
daemons during testing.

-- 
Christian Theune · c...@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


signature.asc
Description: This is a digitally signed message part
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


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

2009-04-02 Thread Dieter Maurer
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.



-- 
Dieter
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


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

2009-04-02 Thread Marius Gedminas
On Thu, Apr 02, 2009 at 01:30:38PM +0200, Christian Theune wrote:
 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.
 
 Any objections?

+99

I would dearly love to have --exit-with-status on by default, for
unrelated reasons.

Marius Gedminas
-- 
http://pov.lt/ -- Zope 3 consulting and development


signature.asc
Description: Digital signature
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )