Bug 2048796 - Unit tests fail with "TypeError: '>' not supported between instances of 'MagicMock' and 'int'"
Summary: Unit tests fail with "TypeError: '>' not supported between instances of 'Magi...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: python-neutron-lib
Version: 17.0 (Wallaby)
Hardware: Unspecified
OS: Unspecified
high
medium
Target Milestone: ---
: ---
Assignee: Rodolfo Alonso
QA Contact: Maor
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-01-31 20:42 UTC by Arie Bregman
Modified: 2022-09-21 12:19 UTC (History)
6 users (show)

Fixed In Version: python-neutron-lib-2.10.2-0.20220208102730.6bbae46.el8ost
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-09-21 12:18:58 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
OpenStack gerrit 806129 0 None MERGED Disable "oslo.messaging" metrics 2022-02-07 17:28:03 UTC
Red Hat Issue Tracker OSP-12403 0 None Waiting on Customer unable to migrate centos from vmware 2022-05-18 09:10:21 UTC
Red Hat Product Errata RHEA-2022:6543 0 None None None 2022-09-21 12:19:23 UTC

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


Note You need to log in before you can comment on or make changes to this bug.