Unit test failure with Python 3.11

Bug #1996527 reported by Thomas Goirand
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Medium
Brian Haley

Bug Description

Hi,

In Debian, we're trying to switch to 3.11 before the Bookworm freeze in January.

Rebuilding Neutron under Python 3.11 fails:

FAIL: neutron.tests.unit.plugins.ml2.drivers.ovn.mech_driver.test_mech_driver.TestOVNMechanismDriverPortsV2.test__port_provisioned_no_binding
neutron.tests.unit.plugins.ml2.drivers.ovn.mech_driver.test_mech_driver.TestOVNMechanismDriverPortsV2.test__port_provisioned_no_binding
----------------------------------------------------------------------
testtools.testresult.real._StringException: Traceback (most recent call last):
  File "/<<PKGBUILDDIR>>/neutron/tests/unit/plugins/ml2/drivers/ovn/mech_driver/test_mech_driver.py", line 2817, in setUp
    ovn_conf.cfg.CONF.set_override('ovn_metadata_enabled', False,
  File "/usr/lib/python3/dist-packages/oslo_config/cfg.py", line 2077, in __inner
    result = f(self, *args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/oslo_config/cfg.py", line 2460, in set_override
    opt_info = self._get_opt_info(name, group)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/oslo_config/cfg.py", line 2869, in _get_opt_info
    group = self._get_group(group)
            ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/oslo_config/cfg.py", line 2838, in _get_group
    raise NoSuchGroupError(group_name)
oslo_config.cfg.NoSuchGroupError: no such group [ovn]

and 145 more like this one...

This looks weird to me though, and unrelated to OVN.

Cheers,

Thomas

Tags: ovn unittest
Revision history for this message
Brian Haley (brian-haley) wrote :

Looks like there are two missing register_opts() calls, a similar bug was fixed last month in that file. I'll push a quick patch but can't test it locally as I'm hitting a python 3.11 issue with yappi/cpython, and there doesn't seem to be a non-voting gate job for it yet.

tags: added: ovn unittest
Changed in neutron:
status: New → Confirmed
importance: Undecided → Medium
assignee: nobody → Brian Haley (brian-haley)
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/+/864448

Changed in neutron:
status: Confirmed → 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/+/864448
Committed: https://opendev.org/openstack/neutron/commit/c5ee9f349548b5bc842054aa26118e205c490aa2
Submitter: "Zuul (22348)"
Branch: master

commit c5ee9f349548b5bc842054aa26118e205c490aa2
Author: Brian Haley <email address hidden>
Date: Mon Nov 14 18:06:20 2022 -0500

    Load the required configuration options in the UT classes

    Some test classes are not loading the required configuration options
    during the setup process. That prevents from launching thoses tests
    or classes individually. This patch solves this issue by importing the
    required options in the "setUp" test class method.

    This is breaking python 3.11 on Debian, not possible to test
    in the gate at the moment.

    Closes-Bug: #1996527

    Change-Id: Ie579df7126ca8d09dbedad8d2254c79ec0d3bc32

Changed in neutron:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 22.0.0.0rc1

This issue was fixed in the openstack/neutron 22.0.0.0rc1 release candidate.

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.