[test]Speed up qemu announce test by mocking sleep
Before Test id Runtime (s) ------------------------------------------------ ----------- LibvirtConnTestCase.test_qemu_announce_self 2.214 TestProfiler.test_all_public_methods_are_traced 0.079 After Test id Runtime (s) ------------------------------------------------ ----------- LibvirtConnTestCase.test_qemu_announce_self 0.242 TestProfiler.test_all_public_methods_are_traced 0.097 Change-Id: Ib3c6e8c53f3eab5328eb30f5fd2e49a4b2e43097 Signed-off-by: Balazs Gibizer <gibi@redhat.com>
This commit is contained in:
@@ -2102,6 +2102,7 @@ class LibvirtConnTestCase(test.NoDBTestCase,
|
||||
|
||||
mock_guest.set_user_password.assert_called_once_with("root", "123")
|
||||
|
||||
@mock.patch("time.sleep", new=mock.Mock())
|
||||
@mock.patch('nova.virt.libvirt.host.Host.get_guest')
|
||||
def test_qemu_announce_self(self, mock_get_guest):
|
||||
# Enable the workaround, configure to call announce_self 3 times
|
||||
|
||||
Reference in New Issue
Block a user