From 32082ebcfc17fdaf83e8f154ce0045e7a1fed16a Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Thu, 8 Nov 2018 16:37:45 -0500 Subject: [PATCH] remove mocks of oslo.service private members We need to completely remove the mocks for oslo.service private members in order to decouple nova from the requirements updates and be able to update the constraint for oslo.service to a new version that has a fixture for managing the sleep call being mocked (applied in the following patch). Change-Id: I0bbd2d7f9d6eb13d97587d867ef4d651809a7dd4 Signed-off-by: Doug Hellmann --- nova/tests/unit/compute/test_compute_mgr.py | 2 -- nova/tests/unit/virt/disk/mount/test_api.py | 2 -- nova/tests/unit/virt/libvirt/test_guest.py | 2 -- 3 files changed, 6 deletions(-) diff --git a/nova/tests/unit/compute/test_compute_mgr.py b/nova/tests/unit/compute/test_compute_mgr.py index 53dc820877fd..a9d0f70e8c17 100644 --- a/nova/tests/unit/compute/test_compute_mgr.py +++ b/nova/tests/unit/compute/test_compute_mgr.py @@ -6437,8 +6437,6 @@ class ComputeManagerBuildInstanceTestCase(test.NoDBTestCase): self.context, mock.sentinel.instance, requested_networks=requested_networks) - @mock.patch('oslo_service.loopingcall._ThreadingEvent.wait', - new=mock.Mock()) @mock.patch('nova.compute.manager.ComputeManager._deallocate_network') @mock.patch('nova.compute.manager.LOG.warning') def test_try_deallocate_network_retry_direct(self, warning_mock, diff --git a/nova/tests/unit/virt/disk/mount/test_api.py b/nova/tests/unit/virt/disk/mount/test_api.py index b92f43abf47b..baaa81ae7d93 100644 --- a/nova/tests/unit/virt/disk/mount/test_api.py +++ b/nova/tests/unit/virt/disk/mount/test_api.py @@ -28,8 +28,6 @@ AUTOMAP_PARTITION = "/dev/nullp77" MAP_PARTITION = "/dev/mapper/nullp77" -# Make RetryDecorator not actually sleep on retries -@mock.patch('oslo_service.loopingcall._ThreadingEvent.wait', new=mock.Mock()) class MountTestCase(test.NoDBTestCase): def _test_map_dev(self, partition): mount = api.Mount(mock.sentinel.image, mock.sentinel.mount_dir) diff --git a/nova/tests/unit/virt/libvirt/test_guest.py b/nova/tests/unit/virt/libvirt/test_guest.py index 4596a8d12057..f0bba568a0c0 100644 --- a/nova/tests/unit/virt/libvirt/test_guest.py +++ b/nova/tests/unit/virt/libvirt/test_guest.py @@ -34,8 +34,6 @@ if sys.version_info > (3,): long = int -# Make RetryDecorator not actually sleep on retries -@mock.patch('oslo_service.loopingcall._ThreadingEvent.wait', new=mock.Mock()) class GuestTestCase(test.NoDBTestCase): def setUp(self):