Grease some more tests hitting RetryDecorator

That's "grease" in the sense of "lubricate", or "make faster". Not in
the sense of "kill with an M3 submachine gun".

Similar optimizations to [1] in libvirt/test_guest (RetryDecorator in
detach_device_with_retry) and disk/mount/test_api (RetryDecorator in
Mount.map_dev).

[1] I60d11fc9a9e8569b1663c7319a5c25b921c5de1a

Change-Id: Ic7ad60ce89c93c0f03c040e244f8191c963c08f3
This commit is contained in:
Eric Fried 2018-08-02 14:26:12 -05:00
parent 05f88f6e3b
commit 63fae18528
2 changed files with 4 additions and 0 deletions

View File

@ -28,6 +28,8 @@ 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)

View File

@ -34,6 +34,8 @@ 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):