Intermittent "expected string or buffer" exception in py3 jobs

Bug #1433800 reported by Ben Nemec
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
oslo.utils
Fix Released
Medium
Unassigned

Bug Description

We've seen this at least a couple of times in the gate, although to my knowledge no one has been able to reproduce locally. In the exception propagation test tests.test_excutils.SaveAndReraiseTest.test_save_and_reraise_exception_dropped there is another exception being raised with the message in the title that is breaking the test.

Example traceback:

2015-03-18 17:35:23.220 | Traceback (most recent call last):
2015-03-18 17:35:23.220 | File "/home/jenkins/workspace/gate-oslo.utils-python34/.tox/py34/lib/python3.4/site-packages/mock.py", line 1201, in patched
2015-03-18 17:35:23.220 | return func(*args, **keywargs)
2015-03-18 17:35:23.220 | File "/home/jenkins/workspace/gate-oslo.utils-python34/tests/test_excutils.py", line 57, in test_save_and_reraise_exception_dropped
2015-03-18 17:35:23.220 | self.assertEqual(str(e), msg)
2015-03-18 17:35:23.220 | File "/home/jenkins/workspace/gate-oslo.utils-python34/.tox/py34/lib/python3.4/site-packages/testtools/testcase.py", line 350, in assertEqual
2015-03-18 17:35:23.221 | self.assertThat(observed, matcher, message)
2015-03-18 17:35:23.221 | File "/home/jenkins/workspace/gate-oslo.utils-python34/.tox/py34/lib/python3.4/site-packages/testtools/testcase.py", line 435, in assertThat
2015-03-18 17:35:23.221 | raise mismatch_error
2015-03-18 17:35:23.221 | testtools.matchers._impl.MismatchError: 'expected string or buffer' != 'second exception'

Revision history for this message
Victor Stinner (vstinner) wrote :

Bash script to reproduce the issue:

set -e -x
find -name "*.pyc" -delete
find -name "__pycache__"|xargs rm -rf
rm -rf .testrepository
tox -e py34
tox -e py27
rm -rf .testrepository
tox -e py34

The sporadic failure may be related to the order of imports?

Revision history for this message
Doug Hellmann (doug-hellmann) wrote :

On a random run on my system I got a more detailed traceback: http://paste.openstack.org/show/195344/

Revision history for this message
Victor Stinner (vstinner) wrote :

Much shorter script to reproduce the bug:

python -m testtools.run oslo_utils.tests.test_netutils.TestIsIPv6Enabled.test_disabled tests.test_excutils.SaveAndReraiseTest.test_save_and_reraise_exception_dropped

I'm working a fix. It's a bug in test_netutils.TestIsIPv6Enabled which never stops a mock.

Revision history for this message
Ben Nemec (bnemec) wrote :
Changed in oslo.utils:
status: Confirmed → Fix Committed
milestone: none → next-liberty
Changed in oslo.utils:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.