Skip to content

Commit 402fe18

Browse files
Zuulopenstack-gerrit
authored andcommitted
Merge "Avoid excessive sleep in vmware unit test"
2 parents ff570ee + 625469d commit 402fe18

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

nova/tests/unit/virt/vmwareapi/test_vm_util.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
# under the License.
1616

1717
import collections
18-
import fixtures
1918

2019
import mock
20+
from oslo_service import fixture as oslo_svc_fixture
2121
from oslo_utils import units
2222
from oslo_utils import uuidutils
2323
from oslo_vmware import exceptions as vexc
@@ -1024,6 +1024,8 @@ def test_create_vm_invalid_guestid(self, mock_log_warn):
10241024
"""Ensure we warn when create_vm() fails after we passed an
10251025
unrecognised guestId
10261026
"""
1027+
# avoid real sleeps during test due to te retry decorator on create_vm
1028+
self.useFixture(oslo_svc_fixture.SleepFixture())
10271029

10281030
found = [False]
10291031

@@ -1042,8 +1044,7 @@ def fake_log_warn(msg, values):
10421044
vm_util.ExtraSpecs(),
10431045
os_type='invalid_os_type')
10441046

1045-
# Because of retries timeout will be raised
1046-
self.assertRaises(fixtures.TimeoutException,
1047+
self.assertRaises(vexc.VMwareDriverException,
10471048
vm_util.create_vm, session, self._instance,
10481049
'folder', config_spec, 'res-pool')
10491050
self.assertTrue(found[0])

0 commit comments

Comments
 (0)