Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pull singleton config check cruft out of SG API
We were going through a bunch of trouble to make the servicegroup API object a singleton, and only check configuration options once. This made the unit tests for the servicegroup drivers more complex than they needed to be. In this patch, we just change the SG API object's constructor to check the appropriate servicegroup configuration options as it needs to, and we adapt the unit tests for all of the SG drivers to not involve the Service object at all. The memcache and DB driver unit tests are converted to NoDBTestCase derivatives, reducing the runtime for the two test cases from around 8 seconds (~1 second per test method) to less than 0.20 seconds. NOTE: The ZooKeeper driver's unit test never runs at all. It is always skipped. NOTE: The next patch in this series refactors the service group API to make the behaviour of all drivers consistent. Currently, the Zookeeper driver has different behaviour from the other drivers in the get_all() method: it raises exception.ServiceGroupUnavailable() if no services are found, unlike the DB and MC drivers, which just return an empty list. Similarly, the ZK driver's join() method returns a FakeLoopingCall() object for some reason, while the other drivers return None. Related blueprint: servicegroup-api-is-up-host-topic Change-Id: Id84ab3fdfcd6b45e1015d6dac9faec5c01fa42ad
- Loading branch information
Showing
6 changed files
with
162 additions
and
327 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.