Comment 0 for bug 1264906

Revision history for this message
ZhiQiang Fan (aji-zqfan) wrote :

I'm not sure is this a bug, since all tests in gate are ok, but this problem occurs both in my notebook and pc.

OS: ubuntu 12.04

tox -epy27 install dependency sucessfully, and only fail on this test.
Ran 1132 tests in 68.032s (-0.524s)
FAILED (id=1, failures=2, skips=14)

$ tox -epy27 -- test_guru_meditation_report
FAIL: unit.reports.test_guru_meditation_report.TestGuruMeditationReport.test_basic_report
tags: worker-0
----------------------------------------------------------------------
Empty attachments:
  pythonlogging:'openstack.common'
  stderr
  stdout

Traceback (most recent call last):
  File "/home/zqfan/openstack/oslo-incubator/tests/unit/reports/test_guru_meditation_report.py", line 86, in test_basic_report
    report_lines[len(target_str_header)]))
  File "/usr/lib/python2.7/unittest/case.py", line 420, in assertTrue
    raise self.failureException(msg)
AssertionError: None is not true

After insert `print(report_lines[len(target_str_header)], file=sys.stderr)` in front of line 86:
$ tox -epy27 -- test_guru_meditation_report
FAIL: unit.reports.test_guru_meditation_report.TestGuruMeditationReport.test_basic_report
tags: worker-0
----------------------------------------------------------------------
Empty attachments:
  pythonlogging:'openstack.common'
  stdout

stderr: {{{------ Thread #-1221338368 ------}}}

Traceback (most recent call last):
  File "/home/zqfan/openstack/oslo-incubator/tests/unit/reports/test_guru_meditation_report.py", line 87, in test_basic_report
    report_lines[len(target_str_header)]))
  File "/usr/lib/python2.7/unittest/case.py", line 420, in assertTrue
    raise self.failureException(msg)
AssertionError: None is not true

Fix in line 86:
self.assertTrue(re.match(r'------(\s+)Thread #-?\d+\1\s?------',
                                 report_lines[len(target_str_header)]))
$ tox -epy27 -- test_guru_meditation_report
  py27: commands succeeded
  congratulations :)

The negative thread id can be a format error, which caused by int overflow problem, but I couldn't locate the original error location, so I report this and provide a temp fix.