Merge "Avoid timeout from service update notification tests"

This commit is contained in:
Zuul 2019-08-12 22:16:52 +00:00 committed by Gerrit Code Review
commit 26cf1b5701
1 changed files with 7 additions and 0 deletions

View File

@ -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(