Cannot run unittests after octavia-lib 1.3.1 release

Bug #1838977 reported by Maciej Jozefczyk
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
networking-ovn
Fix Released
Undecided
Maciej Jozefczyk

Bug Description

Each octavia provider driver unittest and functional test fails on:

ft1.1: networking_ovn.tests.unit.octavia.test_ovn_driver.TestOvnProviderDriver.test_loadbalancer_failover_StringException: Traceback (most recent call last):
  File "networking_ovn/tests/unit/octavia/test_ovn_driver.py", line 74, in setUp
    self.driver = ovn_driver.OvnProviderDriver()
  File "networking_ovn/octavia/ovn_driver.py", line 1554, in __init__
    self._ovn_helper = OvnProviderHelper()
  File "networking_ovn/octavia/ovn_driver.py", line 189, in __init__
    self._octavia_driver_lib = o_driver_lib.DriverLibrary()
  File "/home/zuul/src/opendev.org/openstack/networking-ovn/.tox/py27/local/lib/python2.7/site-packages/octavia_lib/api/drivers/driver_lib.py", line 53, in __init__
    self._check_for_socket_ready(status_socket)
  File "/home/zuul/src/opendev.org/openstack/networking-ovn/.tox/py27/local/lib/python2.7/site-packages/tenacity/__init__.py", line 292, in wrapped_f
    return self.call(f, *args, **kw)
  File "/home/zuul/src/opendev.org/openstack/networking-ovn/.tox/py27/local/lib/python2.7/site-packages/tenacity/__init__.py", line 358, in call
    do = self.iter(retry_state=retry_state)
  File "/home/zuul/src/opendev.org/openstack/networking-ovn/.tox/py27/local/lib/python2.7/site-packages/tenacity/__init__.py", line 331, in iter
    raise retry_exc.reraise()
  File "/home/zuul/src/opendev.org/openstack/networking-ovn/.tox/py27/local/lib/python2.7/site-packages/tenacity/__init__.py", line 167, in reraise
    raise self.last_attempt.result()
  File "/home/zuul/src/opendev.org/openstack/networking-ovn/.tox/py27/local/lib/python2.7/site-packages/concurrent/futures/_base.py", line 455, in result
    return self.__get_result()
  File "/home/zuul/src/opendev.org/openstack/networking-ovn/.tox/py27/local/lib/python2.7/site-packages/tenacity/__init__.py", line 361, in call
    result = fn(*args, **kwargs)
  File "/home/zuul/src/opendev.org/openstack/networking-ovn/.tox/py27/local/lib/python2.7/site-packages/octavia_lib/api/drivers/driver_lib.py", line 44, in _check_for_socket_ready
    'socket: {}'.format(socket)))
octavia_lib.api.drivers.exceptions.DriverAgentNotFound: Unable to open the driver agent socket: /var/run/octavia/status.sock

Changed in networking-ovn:
assignee: nobody → Maciej Jozefczyk (maciej.jozefczyk)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to networking-ovn (master)

Reviewed: https://review.opendev.org/674574
Committed: https://git.openstack.org/cgit/openstack/networking-ovn/commit/?id=b2b5e89bca25570a757c62fc6e30277365dae456
Submitter: Zuul
Branch: master

commit b2b5e89bca25570a757c62fc6e30277365dae456
Author: Maciej Józefczyk <email address hidden>
Date: Thu Aug 8 12:25:13 2019 +0000

    Fix gateway blockers

    This patch squaches two commits:

    1) Do not modify passed by reference variables in mechanism_driver

    Test test_update_port_with_empty_data [0] from TestOVNMechanismDriverPortsV2
    class in neutron is runned agains:
    neutron.tests.unit.plugins.ml2.drivers.mechanism_test.TestMechanismDriver
    which in fact during update_port_postcommit() does nothing with
    the port, only validates it [1].

    In networking-ovn this test is runned against real mechanism driver:
    networking_ovn.ml2.mech_driver.OVNMechanismDriver. This ends with
    little difference - to port dict 'network' information is added
    during call of update_port_postcommit(). The port data itself
    remains the same.
    We shouldn't modify passed by reference variables there. So doing
    deepcopy on all provided data.

    Here comes also the question if this test inheritance is the
    right way.

    2) Add mock for _check_for_socket_ready

    Recently in new octavia-lib release driver-lib provides
    get methods for quering objects by its ids [2].
    We need to mock() socket communication in tests, otherwise
    all the tests fails blocking CI.

    [0] https://review.opendev.org/#/c/673486
    [1] https://github.com/openstack/neutron/blob/master/neutron/tests/unit/plugins/ml2/drivers/mechanism_test.py#L208
    [2] https://github.com/openstack/octavia-lib/commit/d700c00a90fd62b4f6cb9eb30ebe5f619dd6bfda

    Related-Bug: #1838977
    Closes-Bug: #1839434
    Change-Id: I1ad224960173fe896f6eb8049a188d9e82874068

tags: added: networking-ovn-proactive-backport-potential
Changed in networking-ovn:
status: In Progress → Fix Released
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.