Speeding up scheduler tests
Database access is costly in tests and many tests
don't actually need it. This patch provides a
simple way we can speed up the Nova tests by
providing a new base class, `NoDBTestCase` which
allows us to white-list tests not needing database
access.
The following speedups were observed:
With TestCase: Ran 265 tests in 17.080s
With NoDBTestCase: Ran 265 tests in 9.478s
Further optimizaton could be done by fixing
`test_host_filters` to not hit the database. This
will require some effort though in order to
maintain the quality of test coverage since part
of what's doing is testing the code in the DB
layer.
Change-Id: Ic34c4c39d7f680ac501efb459fdeaa51331ffe1c
This commit is contained in:
@@ -28,7 +28,7 @@ from nova import test
|
||||
CONF = cfg.CONF
|
||||
|
||||
|
||||
class SchedulerRpcAPITestCase(test.TestCase):
|
||||
class SchedulerRpcAPITestCase(test.NoDBTestCase):
|
||||
def _test_scheduler_api(self, method, rpc_method, **kwargs):
|
||||
ctxt = context.RequestContext('fake_user', 'fake_project')
|
||||
rpcapi = scheduler_rpcapi.SchedulerAPI()
|
||||
|
||||
Reference in New Issue
Block a user