← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1683606] Re: segments notifier needs to be disabled in unit tests

 

Reviewed:  https://review.openstack.org/459437
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=ac527e242938af280fc26b11b572767177837add
Submitter: Jenkins
Branch:    master

commit ac527e242938af280fc26b11b572767177837add
Author: Trevor McCasland <TM2086@xxxxxxx>
Date:   Tue Apr 25 10:31:34 2017 -0500

    Clean MissingAuthPlugin from unit tests
    
    In the unit test logs there is a MissingAuthPlugin exception
    printed several times.
    
    This patch aims to mock the notifier when it's not being tested.
    When it is being tested, like in the NovaSegmentNotifierTestCase,
    mocking the keystone auth prevents the exception from being
    thrown.
    
    Closes-Bug: #1683606
    Change-Id: I63a1c887f6a7a43f2bddd48b86078e5836cbf438


** Changed in: neutron
       Status: In Progress => Fix Released

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/1683606

Title:
  segments notifier needs to be disabled in unit tests

Status in neutron:
  Fix Released

Bug description:
  I spotted the following tracebacks when running 'tox -epy27 segment'.
  They don't cause failures because they are async notifications, but
  they take up resources and make the logs ugly. It looks like we need
  to add a fixture or mock to the setup of the segments plugin.

  Captured stderr:
  ~~~~~~~~~~~~~~~~
      Traceback (most recent call last):
        File "/home/administrator/git/openstack/neutron/.tox/py27/local/lib/python2.7/site-packages/eventlet/hubs/hub.py", line 457, in fire_timers
          timer()
        File "/home/administrator/git/openstack/neutron/.tox/py27/local/lib/python2.7/site-packages/eventlet/hubs/timer.py", line 58, in __call__
          cb(*args, **kw)
        File "/home/administrator/git/openstack/neutron/.tox/py27/local/lib/python2.7/site-packages/oslo_concurrency/lockutils.py", line 271, in inner
          return f(*args, **kwargs)
        File "neutron/notifiers/batch_notifier.py", line 52, in synced_send
          self._notify()
        File "neutron/notifiers/batch_notifier.py", line 65, in _notify
          self.callback(batched_events)
        File "neutron/services/segments/plugin.py", line 165, in _send_notifications
          event.method(event)
        File "neutron/services/segments/plugin.py", line 189, in _create_or_update_nova_inventory
          self._update_nova_inventory(event)
        File "neutron/services/segments/plugin.py", line 198, in _update_nova_inventory
          IPV4_RESOURCE_CLASS)
        File "neutron/services/segments/placement_client.py", line 33, in wrapper
          return f(self, *a, **k)
        File "neutron/services/segments/placement_client.py", line 116, in get_inventory
          return self._get(url).json()
        File "neutron/services/segments/placement_client.py", line 53, in _get
          **kwargs)
        File "/home/administrator/git/openstack/neutron/.tox/py27/local/lib/python2.7/site-packages/keystoneauth1/session.py", line 758, in get
          return self.request(url, 'GET', **kwargs)
        File "/home/administrator/git/openstack/neutron/.tox/py27/local/lib/python2.7/site-packages/positional/__init__.py", line 101, in inner
          return wrapped(*args, **kwargs)
        File "/home/administrator/git/openstack/neutron/.tox/py27/local/lib/python2.7/site-packages/keystoneauth1/session.py", line 513, in request
          **endpoint_filter)
        File "/home/administrator/git/openstack/neutron/.tox/py27/local/lib/python2.7/site-packages/keystoneauth1/session.py", line 855, in get_endpoint
          auth = self._auth_required(auth, 'determine endpoint URL')
        File "/home/administrator/git/openstack/neutron/.tox/py27/local/lib/python2.7/site-packages/keystoneauth1/session.py", line 798, in _auth_required
          raise exceptions.MissingAuthPlugin(msg_fmt % msg)
      MissingAuthPlugin: An auth plugin is required to determine endpoint URL

To manage notifications about this bug go to:
https://bugs.launchpad.net/neutron/+bug/1683606/+subscriptions


References