test_init_failed_processing_hook fails after https://review.openstack.org/#/c/337043/

Bug #1600141 reported by Alfredo Moralejo
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ironic Inspector
Fix Released
High
Alfredo Moralejo

Bug Description

After merging https://review.openstack.org/#/c/337043/ in stevedore project, test test_init_failed_processing_hook is failing:

$ python -m unittest ironic_inspector.test.unit.test_main.TestInit
Introspection data will not be stored. Change "[processing] store_data" option if this is not the desired behavior
Could not load foo!
F..Starting unauthenticated, please check configuration
Introspection data will not be stored. Change "[processing] store_data" option if this is not the desired behavior
.Introspection data will not be stored. Change "[processing] store_data" option if this is not the desired behavior
.Introspection data will not be stored. Change "[processing] store_data" option if this is not the desired behavior
.
======================================================================
FAIL: test_init_failed_processing_hook (ironic_inspector.test.unit.test_main.TestInit)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/ironic-inspector/.tox/py27/lib/python2.7/site-packages/mock/mock.py", line 1305, in patched
    return func(*args, **keywargs)
  File "ironic_inspector/test/unit/test_main.py", line 636, in test_init_failed_processing_hook
    self.assertRaises(SystemExit, self.service.init)
AssertionError: SystemExit not raised

----------------------------------------------------------------------
Ran 6 tests in 0.256s

FAILED (failures=1)

Test expects SystemExit from https://github.com/openstack/ironic-inspector/blob/master/ironic_inspector/main.py#L417 , but stevedore.NamedExtensionManager is not longer returning KeyError when called with missing names and name_order=True after the mentioned review.

Dmitry Tantsur (divius)
Changed in ironic-inspector:
importance: Undecided → Critical
status: New → Triaged
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to ironic-inspector (master)

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

Changed in ironic-inspector:
assignee: nobody → Alfredo Moralejo (amoralej)
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

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

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

Reviewed: https://review.openstack.org/339491
Committed: https://git.openstack.org/cgit/openstack/ironic-inspector/commit/?id=54cfca7a6b9e3c5df1eb6a1e923bbfe626d1da32
Submitter: Jenkins
Branch: master

commit 54cfca7a6b9e3c5df1eb6a1e923bbfe626d1da32
Author: Alfredo Moralejo <email address hidden>
Date: Fri Jul 8 13:58:58 2016 +0200

    Skip test_init_failed_processing_hook test

    https://review.openstack.org/#/c/337043/ makes this test to fail,
    but proper fix in https://review.openstack.org/339457 requires
    release of stevedore > 1.15.0 not released yet.

    This patch skips the test temporarily until new release is added
    in global requirements.

    Change-Id: Id23efad9c392fc70470d996e37d378efeaf65491
    Partial-Bug: #1600141

Dmitry Tantsur (divius)
Changed in ironic-inspector:
importance: Critical → High
Changed in ironic-inspector:
assignee: Alfredo Moralejo (amoralej) → Dmitry Tantsur (divius)
Changed in ironic-inspector:
assignee: Dmitry Tantsur (divius) → Alfredo Moralejo (amoralej)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Reviewed: https://review.openstack.org/339457
Committed: https://git.openstack.org/cgit/openstack/ironic-inspector/commit/?id=522113da4390347a9cd55e89a7eddf6e14527eff
Submitter: Jenkins
Branch: master

commit 522113da4390347a9cd55e89a7eddf6e14527eff
Author: Alfredo Moralejo <email address hidden>
Date: Fri Jul 8 11:11:13 2016 +0200

    Add callback function to manage missing hooks

    Before https://review.openstack.org/#/c/337043/,
    stevedore.NamedExtensionManager returned KeyError
    when calling with non-existing names and name_order=True.

    After the mentioned change this is not longer true,
    so we used the just added on_missing_entrypoints_callback option
    to customize the behavior in this cases and make it raise
    a custom exception MissingHookError.

    Change-Id: I1f1edc0b7a82a16bf9be4113db61ee1cd0080db4
    Closes-Bug: #1600141

Changed in ironic-inspector:
status: In Progress → Fix Released
Revision history for this message
Davanum Srinivas (DIMS) (dims-v) wrote : Fix included in openstack/ironic-inspector 4.1.0

This issue was fixed in the openstack/ironic-inspector 4.1.0 release.

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.