nova/nova
Stephen Finucane 1a4a521fef test_rpc: Stop f****** with global state
We're occasionally seeing stacktraces like this in our tests:

  Fatal Python error: Cannot recover from stack overflow.

  Current thread 0x00007fe66549f740 (most recent call first):
    File "...nova/.tox/py36/lib/python3.6/site-packages/oslo_config/cfg.py", line 2614 in _get
    File "...nova/.tox/py36/lib/python3.6/site-packages/oslo_config/cfg.py", line 2183 in __getattr__
    File "...nova/.tox/py36/lib/python3.6/site-packages/oslo_config/cfg.py", line 2614 in _get
    File "...nova/.tox/py36/lib/python3.6/site-packages/oslo_config/cfg.py", line 2183 in __getattr__
    File "...nova/.tox/py36/lib/python3.6/site-packages/oslo_config/cfg.py", line 2614 in _get
    ...

From a look at the oslo.config source, this seems to be occurring
because 'ConfigOpts.__cache' is somehow undefined, which results in the
'_get' method attempting to call '__getattr__' [1], which calls '_get'
[2], which calls '__getattr__' and so on.

The exact reason this is happening isn't clear, but what is clear is
that how we handle global config options in the tests that are failing
is very strange and potentially subject to race conditions. We have a
clear pattern for mocking everything and anything - the mock module -
and we should be using this here. Start doing so, reworking a lot of the
tests in the process, in order to avoid messing with oslo.config and
triggering the issue entirely.

[1] https://github.com/openstack/oslo.config/blob/6.8.1/oslo_config/cfg.py#L2614
[2] https://github.com/openstack/oslo.config/blob/6.8.1/oslo_config/cfg.py#L2183

Change-Id: I468cef94185a1b59f379ca527050450e03664c67
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
Closes-Bug: #1825435
2019-04-26 12:21:16 +01:00
..
api Stop handling cells v1 in '/os-servers' API 2019-04-16 18:26:17 +01:00
cells Per aggregate scheduling weight 2019-01-21 11:48:44 +08:00
cmd Stop handling cells v1 for console authentication 2019-04-16 18:26:17 +01:00
common
compute Remove old-style cell v1 instance listing 2019-04-16 18:26:17 +01:00
conductor Merge "trivial: Remove dead code" 2019-04-08 18:13:01 +00:00
conf Stop handling cells v1 for console authentication 2019-04-16 18:26:17 +01:00
console Stop handling cells v1 for console authentication 2019-04-16 18:26:17 +01:00
consoleauth Stop handling cells v1 for console authentication 2019-04-16 18:26:17 +01:00
db Merge "Delete require_instance_exists_using_uuid" 2019-04-26 08:28:39 +00:00
hacking Bump to hacking 1.1.0 2019-04-12 16:23:49 +01:00
image Share snapshot image membership with instance owner 2019-02-08 18:06:27 -05:00
ipv6
keymgr
locale Imported Translations from Zanata 2019-03-22 06:26:27 +00:00
network Merge "conf: Undeprecate and move the 'dhcp_domain' option" 2019-04-16 12:48:40 +00:00
notifications Remove CellMappingPayload database_connection and transport_url fields 2019-04-04 09:59:12 -04:00
objects Drop migrate_keypairs_to_api_db data migration 2019-04-03 11:42:48 -04:00
pci Add get_instance_pci_request_from_vif 2019-03-07 11:37:53 +02:00
policies Remove '/os-cells' REST APIs 2019-04-16 18:26:13 +01:00
privsep Add test coverage for nova.privsep.qemu. 2019-04-04 20:44:01 +00:00
scheduler Change a log level for overwriting allocation 2019-04-08 16:29:10 +09:00
servicegroup Fix deprecation warning for threadgroup.add_timer 2019-02-07 09:37:00 -05:00
tests test_rpc: Stop f****** with global state 2019-04-26 12:21:16 +01:00
virt Fix {min|max}_version in ironic Adapter setup 2019-04-22 16:41:48 +00:00
vnc Deprecate the nova-xvpvncproxy service 2018-10-15 10:03:13 +01:00
volume Bump to hacking 1.1.0 2019-04-12 16:23:49 +01:00
__init__.py Eventlet monkey patching should be as early as possible 2019-03-22 09:27:16 +00:00
availability_zones.py
baserpc.py
block_device.py Add method to generate device names universally 2019-01-15 18:55:11 +00:00
cache_utils.py
config.py Configure placement DB context manager for nova-manage/status 2018-09-05 10:29:48 -04:00
context.py Bump to hacking 1.1.0 2019-04-12 16:23:49 +01:00
crypto.py
debugger.py
exception.py Merge "Added mount fstype based validation of Quobyte mounts" 2019-04-05 17:41:13 +00:00
exception_wrapper.py
filters.py
hooks.py
i18n.py
loadables.py
manager.py
monkey_patch.py Bump to hacking 1.1.0 2019-04-12 16:23:49 +01:00
policy.py Fix string interpolations in logging calls 2019-01-29 15:06:39 +09:00
profiler.py
quota.py Merge "quota: remove defaults kwarg in get_project_quotas" 2019-02-26 13:26:24 +00:00
rc_fields.py Switch to using os-resource-classes 2019-02-07 11:11:09 +00:00
rpc.py test_rpc: Stop f****** with global state 2019-04-26 12:21:16 +01:00
safe_utils.py
service.py Remove 'nova-cells' service 2019-04-09 17:15:37 +01:00
service_auth.py
test.py Only set oslo_messaging_notifications.driver if using RPCFixture 2019-04-19 10:52:57 -04:00
utils.py Eventlet monkey patching should be as early as possible 2019-03-22 09:27:16 +00:00
version.py
weights.py Per aggregate scheduling weight 2019-01-21 11:48:44 +08:00
wsgi.py