Unit tests fail sometimes

Bug #1245920 reported by Yuriy Zveryanskyy
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ironic
Fix Released
Undecided
Yuriy Zveryanskyy

Bug Description

I get this error on master 1-2 times from 10.

Traceback (most recent call last):
  File "ironic/tests/conductor/test_node_manager.py", line 161, in test_load_non_existing_driver
    self.non_existing_driver_name)
  File "/home/yzveryanskyy/ironic/.tox/py26/lib/python2.6/site-packages/testtools/testcase.py", line 394, in assertRaises
    self.assertThat(our_callable, matcher)
  File "/home/yzveryanskyy/ironic/.tox/py26/lib/python2.6/site-packages/testtools/testcase.py", line 406, in assertThat
    mismatch = matcher.match(matchee)
  File "/home/yzveryanskyy/ironic/.tox/py26/lib/python2.6/site-packages/testtools/matchers/_exception.py", line 99, in match
    mismatch = self.exception_matcher.match(exc_info)
  File "/home/yzveryanskyy/ironic/.tox/py26/lib/python2.6/site-packages/testtools/matchers/_higherorder.py", line 61, in match
    mismatch = matcher.match(matchee)
  File "/home/yzveryanskyy/ironic/.tox/py26/lib/python2.6/site-packages/testtools/testcase.py", line 386, in match
    reraise(*matchee)
  File "/home/yzveryanskyy/ironic/.tox/py26/lib/python2.6/site-packages/testtools/matchers/_exception.py", line 92, in match
    result = matchee()
  File "/home/yzveryanskyy/ironic/.tox/py26/lib/python2.6/site-packages/testtools/testcase.py", line 867, in __call__
    return self._callable_object(*self._args, **self._kwargs)
  File "ironic/conductor/resource_manager.py", line 104, in load_driver
    driver = self._driver_factory[driver_name]
AttributeError: 'NodeManager' object has no attribute '_driver_factory'

Changed in ironic:
assignee: nobody → Yuriy Zveryanskyy (yzveryanskyy)
status: New → In Progress
Revision history for this message
Viktor Serhieiev (vsergeyev) wrote :

It's looks like, that there is some dependencies between tests...
This test reproduced if we run tests only for test_node_manager. For example, you can use such command to get this error:

tox -e py27 -- ironic.tests.conductor.test_node_manager

By the way, tests passed with no issues, if tests module test_manager runs before test_node_manager.

Revision history for this message
Lucas Alvares Gomes (lucasagomes) wrote :

I see, it might be the singleton nature of _extension_manager attribute of the DriverFactory class, now I could reproduce the problem :) Thanks Victor!

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to ironic (master)

Reviewed: https://review.openstack.org/53877
Committed: http://github.com/openstack/ironic/commit/e9de066b90e82f5407e8dfe1c024e85ffb4c6c3a
Submitter: Jenkins
Branch: master

commit e9de066b90e82f5407e8dfe1c024e85ffb4c6c3a
Author: Yuriy Zveryanskyy <email address hidden>
Date: Fri Oct 25 17:43:31 2013 +0300

    Fix test node manager

    _fake_init which did not init _driver_factory
    attribute of NodeManager removed from test case.

    Closes-Bug: #1245920
    Change-Id: I8b081ad41c6fd2daad2156059ce3d74039a6f18c

Changed in ironic:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in ironic:
milestone: none → icehouse-1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in ironic:
milestone: icehouse-1 → 2014.1
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.