Bug 2048796

Summary: Unit tests fail with "TypeError: '>' not supported between instances of 'MagicMock' and 'int'"
Product: Red Hat OpenStack Reporter: Arie Bregman <abregman>
Component: python-neutron-libAssignee: Rodolfo Alonso <ralonsoh>
Status: CLOSED ERRATA QA Contact: Maor <mblue>
Severity: medium Docs Contact:
Priority: high    
Version: 17.0 (Wallaby)CC: apevec, ccamposr, ekuris, jjoyce, jschluet, lhh
Target Milestone: ---Keywords: AutomationBlocker, Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python-neutron-lib-2.10.2-0.20220208102730.6bbae46.el8ost Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-09-21 12:18:58 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Arie Bregman 2022-01-31 20:42:59 UTC
Description of problem:

The following unit tests fail:

neutron_lib.tests.unit.test_rpc.TimeoutTestCase.test_method_timeout_increases_on_timeout_exception
neutron_lib.tests.unit.test_rpc.TimeoutTestCase.test_method_timeout_sleep
neutron_lib.tests.unit.test_rpc.TimeoutTestCase.test_timeouts_for_methods_tracked_independently
neutron_lib.tests.unit.test_rpc.TimeoutTestCase.test_method_timeout_config_ceiling
neutron_lib.tests.unit.test_rpc.TimeoutTestCase.test_method_timeout_increases_with_prepare
neutron_lib.tests.unit.test_rpc.TimeoutTestCase.test_timeout_unaffected_when_explicitly_set

------------------------
All fail with the same traceback:

File "/root/src/x/python-neutron-lib/neutron_lib/tests/unit/test_rpc.py", line 393, in test_timeouts_for_namespaces_tracked_independently self.client.call(self.call_context, 'method')

       File "/root/src/x/python-neutron-lib/.tox/py39/lib/python3.9/site-packages/oslo_messaging/rpc/client.py", line 528, in call
return self.prepare().call(ctxt, method, **kwargs)

File "/root/src/x/python-neutron-lib/neutron_lib/rpc.py", line 157, in call
return self._original_context.call(ctxt, method, **kwargs)

 File "/root/src/x/python-neutron-lib/.tox/py39/lib/python3.9/site-packages/oslo_messaging/rpc/client.py", line 185, in call
with metrics.get_collector(self.conf, "rpc_client",

File "/root/src/x/python-neutron-lib/.tox/py39/lib/python3.9/site-packages/oslo_messaging/_metrics/client.py", line 86, in __enter__
send_method(**self.args)

File "/root/src/x/python-neutron-lib/.tox/py39/lib/python3.9/site-packages/oslo_messaging/_metrics/client.py", line 162, in rpc_client_invocation_start_total
 self.put_rpc_client_metrics_to_txqueue(

File "/root/src/x/python-neutron-lib/.tox/py39/lib/python3.9/site-packages/oslo_messaging/_metrics/client.py", line 158, in put_rpc_client_metrics_to_txqueue
self.put_into_txqueue(metric_name, action, **kwargs)

File "/root/src/x/python-neutron-lib/.tox/py39/lib/python3.9/site-packages/oslo_messaging/_metrics/client.py", line 107, in put_into_txqueue
self.tx_queue.put_nowait(m)

File "/usr/lib64/python3.9/queue.py", line 191, in put_nowait
return self.put(item, block=False)

File "/usr/lib64/python3.9/queue.py", line 134, in put
if self.maxsize > 0:
TypeError: '>' not supported between instances of 'MagicMock' and 'int'

--------------------------
Steps to Reproduce:
1. Clone the project (OSP 17)
2. Run tox py39 tests

Comment 3 Maor 2022-05-17 12:48:10 UTC
Verified on the following job with recent weekly changes, using tox with py39:
https://sf.hosted.upshift.rdu2.redhat.com/zuul/t/osp-internal/build/0b5d552a290d4659b8c44e02b58df590/console

The following unit tests pass:
neutron_lib.tests.unit.test_rpc.TimeoutTestCase.test_method_timeout_increases_on_timeout_exception
neutron_lib.tests.unit.test_rpc.TimeoutTestCase.test_method_timeout_sleep
neutron_lib.tests.unit.test_rpc.TimeoutTestCase.test_timeouts_for_methods_tracked_independently
neutron_lib.tests.unit.test_rpc.TimeoutTestCase.test_method_timeout_config_ceiling
neutron_lib.tests.unit.test_rpc.TimeoutTestCase.test_method_timeout_increases_with_prepare
neutron_lib.tests.unit.test_rpc.TimeoutTestCase.test_timeout_unaffected_when_explicitly_set

Comment 7 errata-xmlrpc 2022-09-21 12:18:58 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Release of components for Red Hat OpenStack Platform 17.0 (Wallaby)), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2022:6543