Colorizer throws exception on failed tests

Bug #1183602 reported by Ben Nemec
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Undecided
Michael Kerrin

Bug Description

When running tests using run_tests.sh, if one of the tests fails I am seeing the following error:

Traceback (most recent call last):
  File "tools/colorizer.py", line 329, in <module>
    if runner.run(test).wasSuccessful():
  File "/usr/lib/python2.7/unittest/runner.py", line 151, in run
    test(result)
  File "/opt/stack/nova/.venv/local/lib/python2.7/site-packages/subunit/__init__.py", line 1196, in __call__
    return self.run(result)
  File "/opt/stack/nova/.venv/local/lib/python2.7/site-packages/subunit/__init__.py", line 1204, in run
    protocol.lineReceived(line)
  File "/opt/stack/nova/.venv/local/lib/python2.7/site-packages/subunit/__init__.py", line 574, in lineReceived
    self._state.lineReceived(line)
  File "/opt/stack/nova/.venv/local/lib/python2.7/site-packages/subunit/__init__.py", line 411, in lineReceived
    self.details_parser.lineReceived(line)
  File "/opt/stack/nova/.venv/local/lib/python2.7/site-packages/subunit/details.py", line 119, in lineReceived
    self._parse_state(line)
  File "/opt/stack/nova/.venv/local/lib/python2.7/site-packages/subunit/details.py", line 84, in _look_for_content
    self._state.endDetails()
  File "/opt/stack/nova/.venv/local/lib/python2.7/site-packages/subunit/__init__.py", line 406, in endDetails
    self._report_outcome()
  File "/opt/stack/nova/.venv/local/lib/python2.7/site-packages/subunit/__init__.py", line 437, in _report_outcome
    details=self.details_parser.get_details())
  File "/opt/stack/nova/.venv/local/lib/python2.7/site-packages/testtools/testresult/real.py", line 1151, in addFailure
    return self.decorated.addFailure(test, err)
  File "tools/colorizer.py", line 236, in addFailure
    self._addResult(test, 'FAIL', 'red', 'F', False)
  File "tools/colorizer.py", line 205, in _addResult
    test_class, test_name = name.rsplit('.', 1)
ValueError: need more than 1 value to unpack
close failed in file object destructor:
sys.excepthook is missing
lost sys.stderr

This makes it impossible to even tell which test failed. I suspect it may be related to https://bugs.launchpad.net/nova/+bug/1168516 . I made a change to colorizer.py which somewhat fixes the problem, although it still leaves a bogus process-returncode test in the output. I'll go ahead and submit my change and maybe somebody who knows more about this than me can suggest a better fix.

Changed in nova:
assignee: nobody → Ben Nemec (bnemec)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/30883

Changed in nova:
assignee: Ben Nemec (bnemec) → Michael Kerrin (michael-kerrin-w)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/30883
Committed: http://github.com/openstack/nova/commit/c182319039822346e9bc3f31a796fd45dcc35450
Submitter: Jenkins
Branch: master

commit c182319039822346e9bc3f31a796fd45dcc35450
Author: Michael Kerrin <email address hidden>
Date: Wed May 29 12:43:53 2013 +0000

    Fix colorizier thowing exception when a test fails

    This failure in colorizier was hidding the actual error
    in the tests. If we ran enough tests it also became difficult
    to see which test had actually failed.

    Fixes: bug 1183602

    Change-Id: I806da8f13040b38258de7f3e0fa7b62700bdcead

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → havana-2
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: havana-2 → 2013.2
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.