[ZCM] [ZC] 2113/10 Assign "zopectl test does not stop when Ctrl-C'ed"

Collector: Zope Bugs, Features, and Patches ... zope-coders-admin at zope.org
Mon Jul 3 20:48:55 EDT 2006


Issue #2113 Update (Assign) "zopectl test does not stop when Ctrl-C'ed"
 Status Accepted, Zope/bug+solution medium
To followup, visit:
  http://www.zope.org/Collectors/Zope/2113

==============================================================
= Assign - Entry #10 by tseaver on Jul 3, 2006 8:48 pm

 Supporters added: chrism, efge, jshell, urbanape; removed: tseaver


Uploaded:  "issue_2113_redux.patch"
 - http://www.zope.org/Collectors/Zope/2113/issue_2113_redux.patch/view
I have an improved version of the patch which seems to make running
tests from within the zopectl shell happy on Linux.  Again, can
the Mac guys test / improve it for their machines?
________________________________________
= Comment - Entry #9 by tseaver on May 27, 2006 11:36 am

There is a workaround for the "misdelivered SIGINT" problem in
multi-threaded Python apps posted here:

  http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/496735

I'll look into adapting it for this case.
________________________________________
= Assign - Entry #8 by tseaver on May 20, 2006 12:33 pm

 Supporters added: tseaver; removed: ajung, andreasjung, chrism, efge, jens, jshell, urbanape

Thanks.  I see that behavior as well, but sporadically (likely it
depends on whether the Ctrl-C happends "between" tests or not.

I'll have to wrestle with finding a better fix, then.
________________________________________
= Comment - Entry #7 by jens on May 20, 2006 5:47 am

With the two changes suggested by Florent (swapping the arguments to the os.kill call and fixing the typo "default_int_hander") I see the same behavior in OS X that I saw before applying the patch, namely when doing something like...

$ bin/zopectl test -m CMFCore

... then hitting CTRL-C while the tests run will not kill the child. I'm returned back to the shell prompt, but the tests are still running in the background and produce dots.

System is OS X 10.4.6 on PPC, Zope 2.9 branch from a few weeks ago, self-compiled Python 2.4.2.

________________________________________
= Comment - Entry #6 by efge on May 18, 2006 1:14 pm

Doh, that's just a typo in the patch.

With that fixed, it seems to work well (although I have two tracebacks but oh well...).
________________________________________
= Comment - Entry #5 by efge on May 18, 2006 1:10 pm

I get:
  File "...zope/lib/python/Zope2/Startup/zopectl.py", line 264, in _delegate_SIGINT
    signal.default_int_hander(signum, frame)
AttributeError: 'module' object has no attribute 'default_int_hander'

Although at the command prompt I have:
 >>> import signal
 >>> signal.default_int_handler
 <built-in function default_int_handler>

________________________________________
= Comment - Entry #4 by efge on May 18, 2006 1:07 pm

You swapped the arguments to os.kill...

________________________________________
= Assign - Entry #3 by tseaver on May 18, 2006 12:48 pm

 Supporters added: ajung, andreasjung, chrism, efge, jens, jshell, urbanape; removed: tseaver


Uploaded:  "collector_2113.patch"
 - http://www.zope.org/Collectors/Zope/2113/collector_2113.patch/view
"This time for shure!"

MacOS weenies^X^X^X^X^X^X^Xusers, please test that this patch
doesn't break anything for you (even better, that you can Ctrl-C
a running 'zopectl test' and have it actually work).
________________________________________
= Comment - Entry #2 by tseaver on May 18, 2006 12:38 pm


________________________________________
= Request - Entry #1 by tseaver on May 18, 2006 12:35 pm

 Status: Pending => Accepted

 Supporters added: tseaver

For background, see:

  http://www.zope.org/Collectors/Zope/1904\

Currently, pressing Ctrl-C while 'zopectl test' is running kills off the
zopectl process, but not the child running the test.  I have a fix for
this which works on Linux, but I need somebody to test it on MacOS, as
this is a notoriously fragile cross-platform bugnest.
==============================================================



More information about the Zope-Collector-Monitor mailing list