unit test failures on master

Bug #1886589 reported by Corey Bryant
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fix Released
networking-odl (Ubuntu)
Fix Released

Bug Description

Running tox -e py38 on ubuntu groovy results in test failures such as:


Captured stderr:
    /home/corey/pkg/victoria/upstream/networking-odl/.tox/py38/lib/python3.8/site-packages/neutron_lib/worker.py:68: DeprecationWarning: PY_SSIZE_T_CLEAN will be required for '#' formats
  self._parent_proctitle = setproctitle.getproctitle()

Captured traceback:
    Traceback (most recent call last):

      File "/home/corey/pkg/victoria/upstream/networking-odl/.tox/py38/lib/python3.8/site-packages/fixtures/fixture.py", line 125, in cleanUp
    return self._cleanups(raise_errors=raise_first)

      File "/home/corey/pkg/victoria/upstream/networking-odl/.tox/py38/lib/python3.8/site-packages/fixtures/callmany.py", line 89, in __call__
    reraise(error[0], error[1], error[2])

      File "/home/corey/pkg/victoria/upstream/networking-odl/.tox/py38/lib/python3.8/site-packages/testtools/_compat3x.py", line 16, in reraise
    raise exc_obj.with_traceback(exc_tb)

      File "/home/corey/pkg/victoria/upstream/networking-odl/.tox/py38/lib/python3.8/site-packages/fixtures/callmany.py", line 83, in __call__
    cleanup(*args, **kwargs)

      File "/home/corey/pkg/victoria/upstream/networking-odl/networking_odl/tests/base.py", line 135, in _restore
    if mock._is_started(self.patcher):

    AttributeError: module 'unittest.mock' has no attribute '_is_started'

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to networking-odl (master)

Related fix proposed to branch: master
Review: https://review.opendev.org/739949

Changed in networking-odl:
status: New → Confirmed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on networking-odl (master)

Change abandoned by Lajos Katona (<email address hidden>) on branch: master
Review: https://review.opendev.org/739949

Revision history for this message
Lajos Katona (lajos-katona) wrote :

Corey, could you check with this one:
for some reason LP didn't linked it here

Revision history for this message
Corey Bryant (corey.bryant) wrote :

Lajos, tests pass with your patch plus a slight modification. I had to add mock to test-requirements.txt. I tested successfully with "mock==3.0.5" and unversioned "mock".

Revision history for this message
Lajos Katona (lajos-katona) wrote :

Corey, instead of mock unittest mock should work now, see: https://review.opendev.org/720956
So that is strange. Are neutron/neutron-lib the latest?

Revision history for this message
Corey Bryant (corey.bryant) wrote :
Download full text (3.8 KiB)

I think the requirements.txt min is too low for neutron. It probably needs to target master for now since 16.0.0 has 'import mock'. I'm not sure why that is. With a fresh git clone of networking-odl and new tox env, tox -e py38 results in errors such as:

--- import errors ---
Failed to import test module: networking_odl.tests.unit.bgpvpn.test_odl_v2
Traceback (most recent call last):
  File "/usr/lib/python3.8/unittest/loader.py", line 436, in _find_test_path
    module = self._get_module_from_name(name)
  File "/usr/lib/python3.8/unittest/loader.py", line 377, in _get_module_from_name
  File "/home/corey/pkg/victoria/upstream/networking-odl/networking_odl/tests/unit/bgpvpn/test_odl_v2.py", line 23, in <module>
    from networking_odl.tests.unit import base_v2
  File "/home/corey/pkg/victoria/upstream/networking-odl/networking_odl/tests/unit/base_v2.py", line 18, in <module>
    from neutron.tests.unit.plugins.ml2 import test_plugin ...


Revision history for this message
Lajos Katona (lajos-katona) wrote :

Yeah, that's always a headache if you have dependencies on not yet released projects, like here for neutron....

Changed in networking-odl (Ubuntu):
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package networking-odl - 1:17.0.0~b2~git2020073014.52a6f383f-0ubuntu1

networking-odl (1:17.0.0~b2~git2020073014.52a6f383f-0ubuntu1) groovy; urgency=medium

  * New upstream snapshot for OpenStack Victoria.
  * d/control: Align (Build-)Depends with upstream.
  * d/control, d/rules: Switch to debhelper-compat 12 and add PYBUILD_NAME.
  * d/control, d/copyright: Update Standards-Version to 4.5.0 and update upstream
  * d/p/workaround-mock-is-started.patch, d/control: Cherry-pick patch from upstream
    gerrit review and ensure use of latest python3-neutron Victoria version,
    required for successful test execution (LP: #1886589).

 -- Corey Bryant <email address hidden> Thu, 30 Jul 2020 14:58:46 -0400

Changed in networking-odl (Ubuntu):
status: Triaged → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to networking-odl (master)

Reviewed: https://review.opendev.org/740315
Committed: https://git.openstack.org/cgit/openstack/networking-odl/commit/?id=0cc249bae09b721a7fa5a50a86069cd307cdcd01
Submitter: Zuul
Branch: master

commit 0cc249bae09b721a7fa5a50a86069cd307cdcd01
Author: elajkat <email address hidden>
Date: Thu Jul 9 14:09:10 2020 +0200

    Workaround mock._is_started

    It seems that on groovy (python 3.8.3) mock._is_started is not working,
    the easiest fix seems to be to workaround that with try / except block.

    Change-Id: Ia579f5f0cfe77e271340e42cd01299a979c8ef27
    Closes-Bug: #1886589

Changed in networking-odl:
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.