Unit test jobs with neutron-lib master(3.9.0) failing

Bug #2043959 reported by yatin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Critical
yatin

Bug Description

Since https://review.opendev.org/c/openstack/neutron-lib/+/895940 the job fails as:-
ft1.2: neutron.tests.unit.plugins.ml2.drivers.agent.test_capabilities.CapabilitiesTest.test_registertesttools.testresult.real._StringException: Traceback (most recent call last):
  File "/home/zuul/src/opendev.org/openstack/neutron/neutron/tests/base.py", line 178, in func
    return f(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/zuul/src/opendev.org/openstack/neutron/neutron/tests/unit/plugins/ml2/drivers/agent/test_capabilities.py", line 47, in test_register
    self._mgr.subscribe.assert_called_with(*args)
  File "/usr/lib/python3.11/unittest/mock.py", line 933, in assert_called_with
    raise AssertionError(_error_message()) from cause
AssertionError: expected call not found.
Expected: subscribe(<Mock id='140017646759568'>, <Mock id='140017646753232'>, 'after_init', 55550000)
Actual: subscribe(<Mock id='140017646759568'>, <Mock id='140017646753232'>, 'after_init', 55550000, False)

ft3.1: neutron.tests.unit.services.logapi.drivers.test_manager.TestHandleResourceCallback.test_subscribe_resources_cbtesttools.testresult.real._StringException: Traceback (most recent call last):
  File "/home/zuul/src/opendev.org/openstack/neutron/neutron/tests/base.py", line 178, in func
    return f(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/zuul/src/opendev.org/openstack/neutron/neutron/tests/unit/services/logapi/drivers/test_manager.py", line 189, in test_subscribe_resources_cb
    self._cb_mgr.subscribe.assert_has_calls(assert_calls)
  File "/usr/lib/python3.11/unittest/mock.py", line 970, in assert_has_calls
    raise AssertionError(
AssertionError: Calls not found.

ft4.1: neutron.tests.unit.services.trunk.rpc.test_backend.ServerSideRpcBackendTest.test___init__testtools.testresult.real._StringException: Traceback (most recent call last):
  File "/home/zuul/src/opendev.org/openstack/neutron/neutron/tests/base.py", line 178, in func
    return f(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/zuul/src/opendev.org/openstack/neutron/neutron/tests/unit/services/trunk/rpc/test_backend.py", line 60, in test___init__
    self._mgr.subscribe.assert_has_calls(calls, any_order=True)
  File "/usr/lib/python3.11/unittest/mock.py", line 986, in assert_has_calls
    raise AssertionError(
AssertionError: 'subscribe' does not contain all of (call(<bound method ServerSideRpcBackend.process_event of <neutron.services.trunk.rpc.backend.ServerSideRpcBackend object at 0x7faa950feed0>>, 'trunk', 'after_create', 55550000), call(<bound method ServerSideRpcBackend.process_event of <neutron.services.trunk.rpc.backend.ServerSideRpcBackend object at 0x7faa950feed0>>, 'trunk', 'after_delete', 55550000), call(<bound method ServerSideRpcBackend.process_event of <neutron.services.trunk.rpc.backend.ServerSideRpcBackend object at 0x7faa950feed0>>, 'subports', 'after_create', 55550000), call(<bound method ServerSideRpcBackend.process_event of <neutron.services.trunk.rpc.backend.ServerSideRpcBackend object at 0x7faa950feed0>>, 'subports', 'after_delete', 55550000)) in its call list, found [call(<bound method ServerSideRpcBackend.process_event of <neutron.services.trunk.rpc.backend.ServerSideRpcBackend object at 0x7faa950feed0>>, 'trunk', 'after_create', 55550000, False), call(<bound method ServerSideRpcBackend.process_event of <neutron.services.trunk.rpc.backend.ServerSideRpcBackend object at 0x7faa950feed0>>, 'subports', 'after_create', 55550000, False), call(<bound method ServerSideRpcBackend.process_event of <neutron.services.trunk.rpc.backend.ServerSideRpcBackend object at 0x7faa950feed0>>, 'trunk', 'after_delete', 55550000, False), call(<bound method ServerSideRpcBackend.process_event of <neutron.services.trunk.rpc.backend.ServerSideRpcBackend object at 0x7faa950feed0>>, 'subports', 'after_delete', 55550000, False)] instead

Need to make these unit tests compatible with neutron-lib 3.9.0.

Example failure:-
https://25f3b33717093a9f4f4e-a759d6b54561529b072782a6b0052389.ssl.cf5.rackcdn.com/periodic/opendev.org/openstack/neutron/master/openstack-tox-py311-with-neutron-lib-master/87a570a/testr_results.html

Builds:-
https://zuul.openstack.org/builds?job_name=openstack-tox-py311-with-neutron-lib-master&job_name=openstack-tox-py311-with-sqlalchemy-master&project=openstack%2Fneutron&skip=0

yatin (yatinkarel)
Changed in neutron:
status: New → Triaged
importance: Undecided → Critical
assignee: nobody → yatin (yatinkarel)
tags: added: gate-failure unittest
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (master)

Fix proposed to branch: master
Review: https://review.opendev.org/c/openstack/neutron/+/901430

Changed in neutron:
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

Reviewed: https://review.opendev.org/c/openstack/neutron/+/901430
Committed: https://opendev.org/openstack/neutron/commit/95b4e8f41dbc56911369733a264a20c4affc1173
Submitter: "Zuul (22348)"
Branch: master

commit 95b4e8f41dbc56911369733a264a20c4affc1173
Author: yatinkarel <email address hidden>
Date: Mon Nov 20 12:29:33 2023 +0530

    Make unit tests compatible with neutron-lib-3.9.0

    A new flag was added with [1], adapt unit tests with it.
    Also drop an older compatibility check which is no longer
    needed as neutron-lib>=3.8.0 already.

    [1] https://review.opendev.org/c/openstack/neutron-lib/+/895940
    Needed-By: https://review.opendev.org/c/openstack/requirements/+/901231
    Closes-Bug: #2043959

    Change-Id: I3b48b418d2d1293cdcf8fefb1b9ff7005bbebb29

Changed in neutron:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to neutron (stable/2023.2)

Related fix proposed to branch: stable/2023.2
Review: https://review.opendev.org/c/openstack/neutron/+/904109

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to neutron (stable/2023.1)

Related fix proposed to branch: stable/2023.1
Review: https://review.opendev.org/c/openstack/neutron/+/904110

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to neutron (stable/2023.2)

Reviewed: https://review.opendev.org/c/openstack/neutron/+/904109
Committed: https://opendev.org/openstack/neutron/commit/496db46e328e2b3fd59330205c1a1b53f7c9a823
Submitter: "Zuul (22348)"
Branch: stable/2023.2

commit 496db46e328e2b3fd59330205c1a1b53f7c9a823
Author: yatinkarel <email address hidden>
Date: Mon Nov 20 12:29:33 2023 +0530

    Make unit tests compatible with neutron-lib 3.8.1

    A new flag was added with [1], adapt unit tests with it.
    Also drop an older compatibility check which is no longer
    needed as neutron-lib>=3.8.0 already.

    [1] https://review.opendev.org/c/openstack/neutron-lib/+/903334
    Related-Bug: #2043959

    Change-Id: I3b48b418d2d1293cdcf8fefb1b9ff7005bbebb29
    (cherry picked from commit 95b4e8f41dbc56911369733a264a20c4affc1173)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to neutron (stable/2023.1)

Reviewed: https://review.opendev.org/c/openstack/neutron/+/904110
Committed: https://opendev.org/openstack/neutron/commit/0aeb703db7e3c6428b04353d5f3f366e74f41ec0
Submitter: "Zuul (22348)"
Branch: stable/2023.1

commit 0aeb703db7e3c6428b04353d5f3f366e74f41ec0
Author: yatinkarel <email address hidden>
Date: Mon Nov 20 12:29:33 2023 +0530

    Make unit tests compatible with neutron-lib 3.4.2

    A new flag was added with [1], adapt unit tests with it.
    Also drop an older compatibility check which is no longer
    needed as neutron-lib>=3.4.0 already.

    [1] https://review.opendev.org/c/openstack/neutron-lib/+/903335
    Related-Bug: #2043959

    Change-Id: I3b48b418d2d1293cdcf8fefb1b9ff7005bbebb29
    (cherry picked from commit 95b4e8f41dbc56911369733a264a20c4affc1173)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 24.0.0.0b1

This issue was fixed in the openstack/neutron 24.0.0.0b1 development milestone.

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.