From e162fd26da3324f5ec00010821949e003a46aa10 Mon Sep 17 00:00:00 2001 From: Dan Smith Date: Tue, 13 Dec 2016 15:25:17 -0800 Subject: [PATCH] Make api_samples tests use simple cell environment The api_samples tests depend on a very static environment where we use the SpawnIsSynchronous fixture. This is somewhat at odds with the locking used in the CellDatabase fixture, which will necessarily recurse at times. Since the api_samples tests are already a bit naive in the service layout, and since they don't care about cells things, we do some monkeywork here to make them use the SingleCellSimple fixture instead of a full-blown multi-cell environment. Change-Id: If1138331f3a46f5aed87e898ce19879a787d435f --- nova/test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nova/test.py b/nova/test.py index c96b05dbd..af5e4131b 100644 --- a/nova/test.py +++ b/nova/test.py @@ -347,7 +347,7 @@ class TestCase(testtools.TestCase): svc = self.useFixture( nova_fixtures.ServiceFixture(name, host, **kwargs)) - if name == 'compute': + if name == 'compute' and self.USES_DB: ctxt = context.get_context() cell = self.cell_mappings[kwargs.pop('cell', CELL1_NAME)] hm = objects.HostMapping(context=ctxt,