Don't use private interface in oslo.service
The _ThreadingEvent class in oslo_service.loopingcall is a private
interface, and backported changes to fix performance issues remove that
class. Since the _ThreadingEvent.wait() function is essentially
synonymous with the LoopingCallBase._sleep() method, substitute the
latter instead. This ensures that the Nova tests will work with both
older and newer versions of oslo.service.
This is a stable-only change because these mocks have already been
replaced with the new oslo_service.fixture.SleepFixture on master by
fded752b16
.
Change-Id: Ie4f27622f6158b1123b2e9dd050f90a3dbd84ea6
Related-Bug: #1798774
This commit is contained in:
parent
2ddb689f87
commit
99b1b3f6f0
|
@ -6390,7 +6390,7 @@ class ComputeManagerBuildInstanceTestCase(test.NoDBTestCase):
|
|||
self.context, mock.sentinel.instance,
|
||||
requested_networks=requested_networks)
|
||||
|
||||
@mock.patch('oslo_service.loopingcall._ThreadingEvent.wait',
|
||||
@mock.patch('oslo_service.loopingcall.LoopingCallBase._sleep',
|
||||
new=mock.Mock())
|
||||
@mock.patch('nova.compute.manager.ComputeManager._deallocate_network')
|
||||
@mock.patch('nova.compute.manager.LOG.warning')
|
||||
|
|
|
@ -29,7 +29,7 @@ MAP_PARTITION = "/dev/mapper/nullp77"
|
|||
|
||||
|
||||
# Make RetryDecorator not actually sleep on retries
|
||||
@mock.patch('oslo_service.loopingcall._ThreadingEvent.wait', new=mock.Mock())
|
||||
@mock.patch('oslo_service.loopingcall.LoopingCallBase._sleep', new=mock.Mock())
|
||||
class MountTestCase(test.NoDBTestCase):
|
||||
def _test_map_dev(self, partition):
|
||||
mount = api.Mount(mock.sentinel.image, mock.sentinel.mount_dir)
|
||||
|
|
|
@ -35,7 +35,7 @@ if sys.version_info > (3,):
|
|||
|
||||
|
||||
# Make RetryDecorator not actually sleep on retries
|
||||
@mock.patch('oslo_service.loopingcall._ThreadingEvent.wait', new=mock.Mock())
|
||||
@mock.patch('oslo_service.loopingcall.LoopingCallBase._sleep', new=mock.Mock())
|
||||
class GuestTestCase(test.NoDBTestCase):
|
||||
|
||||
def setUp(self):
|
||||
|
|
Loading…
Reference in New Issue