Merge "Unit tests: fix absurdly slow tests"

This commit is contained in:
Zuul 2018-01-16 04:31:39 +00:00 committed by Gerrit Code Review
commit 4f3fd51e16
2 changed files with 5 additions and 0 deletions

View File

@ -677,6 +677,7 @@ class SoftwareConfigServiceTest(common.HeatTestCase):
with mock.patch.object(self.ctx.session, 'refresh'):
f = self.engine.software_config._push_metadata_software_deployments
self.patchobject(f.retry, 'sleep')
self.assertRaises(
exception.ConcurrentTransaction,
f,

View File

@ -4839,6 +4839,8 @@ class ServerInternalPortTest(ServersTest):
server._data = {"internal_ports": jsonutils.dumps(port_ids)}
self.patchobject(nova.NovaClientPlugin, 'interface_detach')
self.patchobject(nova.NovaClientPlugin, 'fetch_server')
self.patchobject(nova.NovaClientPlugin.check_interface_detach.retry,
'sleep')
nova.NovaClientPlugin.fetch_server.side_effect = [Fake()] * 10
exc = self.assertRaises(exception.InterfaceDetachFailed,
@ -4966,6 +4968,8 @@ class ServerInternalPortTest(ServersTest):
return_value=True)
self.patchobject(nova.NovaClientPlugin, 'interface_attach')
self.patchobject(nova.NovaClientPlugin, 'fetch_server')
self.patchobject(nova.NovaClientPlugin.check_interface_attach.retry,
'sleep')
# need to mock 11 times: 1 for port 1122, 10 for port 3344
nova.NovaClientPlugin.fetch_server.side_effect = [Fake()] * 11