<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
So, I tried to reproduce, but I actually see the same results with both of these. However, they both show the issue I was hitting, namely, I got no information on where the failure was located:
<div><br>
</div>
<div>
<div>root@devstack-32:/opt/stack/neutron# tox -e py27 -v -- neutron.tests.unit.pcm.test_pcm</div>
<div>using tox.ini: /opt/stack/neutron/tox.ini</div>
<div>using tox-1.6.1 from /usr/local/lib/python2.7/dist-packages/tox/__init__.pyc</div>
<div>py27 reusing: /opt/stack/neutron/.tox/py27</div>
<div> /opt/stack/neutron$ /opt/stack/neutron/.tox/py27/bin/python /opt/stack/neutron/setup.py --name</div>
<div>py27 develop-inst-nodeps: /opt/stack/neutron</div>
<div> /opt/stack/neutron$ /opt/stack/neutron/.tox/py27/bin/pip install -U -e /opt/stack/neutron --no-deps >/opt/stack/neutron/.tox/py27/log/py27-163.log</div>
<div>py27 runtests: commands[0] | python -m neutron.openstack.common.lockutils python setup.py testr --slowest --testr-args=neutron.tests.unit.pcm.test_pcm</div>
<div> /opt/stack/neutron$ /opt/stack/neutron/.tox/py27/bin/python -m neutron.openstack.common.lockutils python setup.py testr --slowest --testr-args=neutron.tests.unit.pcm.test_pcm</div>
<div>running testr</div>
<div>running=OS_STDOUT_CAPTURE=1 OS_STDERR_CAPTURE=1 OS_LOG_CAPTURE=1 ${PYTHON:-python} -m subunit.run discover -t ./ ${OS_TEST_PATH:-./neutron/tests/unit} --list</div>
<div>running=OS_STDOUT_CAPTURE=1 OS_STDERR_CAPTURE=1 OS_LOG_CAPTURE=1 ${PYTHON:-python} -m subunit.run discover -t ./ ${OS_TEST_PATH:-./neutron/tests/unit} --load-list /tmp/tmpkYugPE</div>
<div>running=OS_STDOUT_CAPTURE=1 OS_STDERR_CAPTURE=1 OS_LOG_CAPTURE=1 ${PYTHON:-python} -m subunit.run discover -t ./ ${OS_TEST_PATH:-./neutron/tests/unit} --load-list /tmp/tmpPoDsN3</div>
<div>ouch</div>
<div>======================================================================</div>
<div>FAIL: process-returncode</div>
<div>tags: worker-1</div>
<div>----------------------------------------------------------------------</div>
<div><b>Binary content:</b></div>
<div><b> traceback (test/plain; charset="utf8")</b></div>
<div>======================================================================</div>
<div>FAIL: process-returncode</div>
<div>tags: worker-0</div>
<div>----------------------------------------------------------------------</div>
<div><b>Binary content:</b></div>
<div><b> traceback (test/plain; charset="utf8")</b></div>
<div>Ran 4 (+4) tests in 0.348s</div>
<div>FAILED (id=150, failures=2 (+2))</div>
<div>error: testr failed (1)</div>
<div>ERROR: InvocationError: '/opt/stack/neutron/.tox/py27/bin/python -m neutron.openstack.common.lockutils python setup.py testr --slowest --testr-args=neutron.tests.unit.pcm.test_pcm'</div>
<div>______________________________________________________________________________________________ summary _______________________________________________________________________________________________</div>
<div>ERROR: py27: commands failed</div>
<div><br>
</div>
<div>It looks like there was some traceback, but it doesnt show it. Any ideas how to get around this, as it makes it hard to troubleshoot these types of failures?</div>
<div><br>
</div>
<div>Here is the code:</div>
<div><br>
</div>
<div>
<div># Copyright 2014 Cisco Systems, Inc. All rights reserved.</div>
<div>#</div>
<div># Licensed under the Apache License, Version 2.0 (the "License"); you may</div>
<div># not use this file except in compliance with the License. You may obtain</div>
<div># a copy of the License at</div>
<div>#</div>
<div># <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a></div>
<div>#</div>
<div># Unless required by applicable law or agreed to in writing, software</div>
<div># distributed under the License is distributed on an "AS IS" BASIS, WITHOUT</div>
<div># WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the</div>
<div># License for the specific language governing permissions and limitations</div>
<div># under the License.</div>
<div>#</div>
<div># @author: Paul Michali, Cisco Systems, Inc.</div>
<div><br>
</div>
<div>import sys</div>
<div><br>
</div>
<div>from neutron.tests import base</div>
<div><br>
</div>
<div>def using_sys_exit():</div>
<div> sys.exit(1)</div>
<div><br>
</div>
<div>def using_SystemExit():</div>
<div> raise SystemExit("ouch")</div>
<div><br>
</div>
<div><br>
</div>
<div>class TestSystemExit(base.BaseTestCase):</div>
<div><br>
</div>
<div> def test_using_sys_exit(self):</div>
<div> self.assertIsNone(using_sys_exit())</div>
<div><br>
</div>
<div> def test_using_SystemExit(self):</div>
<div> self.assertIsNone(using_SystemExit())</div>
<div><br>
</div>
</div>
<div><br>
</div>
<div>Regards,</div>
<div><br>
</div>
<div><br>
</div>
<div apple-content-edited="true">
<div>
<div>PCM (Paul Michali)</div>
<div><br>
</div>
<div>MAIL
..
. <a href="mailto:pcm@cisco.com">pcm@cisco.com</a></div>
<div>IRC
..
pcm_ (<a href="http://irc.freenode.com">irc.freenode.com</a>)</div>
<div>TW
... @pmichali</div>
<div>GPG Key
4525ECC253E31A83</div>
<div>Fingerprint .. 307A 96BB 1A4C D2C7 931D 8D2D 4525 ECC2 53E3 1A83</div>
</div>
<div><br>
</div>
<br class="Apple-interchange-newline">
</div>
<br>
<div>
<div>On May 1, 2014, at 1:23 PM, Yuriy Taraday <<a href="mailto:yorik.sar@gmail.com">yorik.sar@gmail.com</a>> wrote:</div>
<br class="Apple-interchange-newline">
<blockquote type="cite">
<div dir="ltr">
<div class="gmail_extra">On Thu, May 1, 2014 at 8:17 PM, Salvatore Orlando <span dir="ltr">
<<a href="mailto:sorlando@nicira.com" target="_blank">sorlando@nicira.com</a>></span> wrote:<br>
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div dir="ltr">The patch you've been looking at just changes the way in which SystemExit is used, it does not replace it with sys.exit.
<div>In my experience sys.exit was causing unit test threads to interrupt abruptly, whereas SystemExit was being caught by the test runner and handled.</div>
</div>
</blockquote>
<div><br>
</div>
<div style="">According to <a href="https://docs.python.org/2.7/library/sys.html#sys.exit">https://docs.python.org/2.7/library/sys.html#sys.exit</a> , sys.exit(n) is an equivalent for raise SystemExit(n), it can be confirmed in the source code here: <a href="http://hg.python.org/cpython/file/2.7/Python/sysmodule.c#l206">http://hg.python.org/cpython/file/2.7/Python/sysmodule.c#l206</a></div>
<div style="">If there's any difference in behavior it seems to be the problem of test runner. For example, it can mock sys.exit somehow.</div>
<div style=""><br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div dir="ltr">
<div>I find therefore a bit strange that you're reporting what appears to be the opposite behaviour.</div>
<div><br>
</div>
<div>Maybe if you could share the code you're working on we can have a look at it and see what's going on.</div>
</div>
</blockquote>
<div><br>
</div>
<div>I'd suggest finding out what's the difference in both of your cases.</div>
</div>
<div class="gmail_extra"><br>
</div>
Coming back to topic, I'd prefer using standard library call because it can be mocked for testing.<br clear="all">
<div><br>
</div>
-- <br>
<br>
<div>Kind regards, Yuriy.</div>
</div>
</div>
_______________________________________________<br>
OpenStack-dev mailing list<br>
<a href="mailto:OpenStack-dev@lists.openstack.org">OpenStack-dev@lists.openstack.org</a><br>
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev<br>
</blockquote>
</div>
<br>
</div>
</body>
</html>