From ce42b6d494f166b42efce660bd3a62aefdb62500 Mon Sep 17 00:00:00 2001 From: Balazs Gibizer Date: Mon, 12 Aug 2019 17:24:14 +0200 Subject: [PATCH] Avoid timeout from service update notification tests Since If32bca070185937ef83f689b7163d965a89ec10a some of the service update notification tests are slow because setting a compute enabled or disabled makes an RPC call to the given compute service. These tests does not have the proper RPC setup so that call times out. Since the notification is still generated the test passes. Waiting for this timeout steals 16 minutes of test execution time unnecessary. This patch stubs the RPC call as that is not necessary for the notification testing and therefore speeds up the tests. Change-Id: I0269c4bd3da0e58593811b11985deb237eefe59e --- .../functional/notification_sample_tests/test_service.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/nova/tests/functional/notification_sample_tests/test_service.py b/nova/tests/functional/notification_sample_tests/test_service.py index facb0a6b35..3005a69fdb 100644 --- a/nova/tests/functional/notification_sample_tests/test_service.py +++ b/nova/tests/functional/notification_sample_tests/test_service.py @@ -49,6 +49,13 @@ class TestServiceUpdateNotificationSamplev2_52(TestServiceNotificationBase): test_services.fake_service_get_by_host_binary) self.stub_out("nova.db.api.service_update", test_services.fake_service_update) + # NOTE(gibi): enable / disable a compute service tries to call + # the compute service via RPC to update placement. However in these + # tests the compute services are faked. So stub out the RPC call to + # avoid waiting for the RPC timeout. The notifications are generated + # regardless of the result of the RPC call anyhow. + self.stub_out("nova.compute.rpcapi.ComputeAPI.set_host_enabled", + lambda *args, **kwargs: None) self.useFixture(utils_fixture.TimeFixture(test_services.fake_utcnow())) self.useFixture(fixtures.SingleCellSimple()) self.service_uuid = test_services.fake_service_get_by_host_binary(