Cleanup zookeeper and fake nodepool in nodepool tests

The nodepool tests set up zookeeper connections and a fake nodepool.
These test resources spawned threads that were leaking and causing
subsequent tests to run with zookeeper and nodepool threads running.
Clean that up.

Change-Id: Ib799d4a40eb51e7bbe71673a082f345235c41019
This commit is contained in:
Clark Boylan 2017-04-24 17:36:11 -07:00
parent f18e3b867e
commit ffe8f8bb81
2 changed files with 3 additions and 0 deletions

View File

@ -31,6 +31,7 @@ class TestNodepoolIntegration(BaseTestCase):
super(TestNodepoolIntegration, self).setUp()
self.zk = zuul.zk.ZooKeeper()
self.addCleanup(self.zk.disconnect)
self.zk.connect('localhost:2181')
self.hostname = socket.gethostname()

View File

@ -37,6 +37,7 @@ class TestNodepool(BaseTestCase):
self.zk_chroot_fixture.zookeeper_chroot)
self.zk = zuul.zk.ZooKeeper()
self.addCleanup(self.zk.disconnect)
self.zk.connect(self.zk_config)
self.hostname = 'nodepool-test-hostname'
@ -49,6 +50,7 @@ class TestNodepool(BaseTestCase):
self.zk_chroot_fixture.zookeeper_host,
self.zk_chroot_fixture.zookeeper_port,
self.zk_chroot_fixture.zookeeper_chroot)
self.addCleanup(self.fake_nodepool.stop)
def waitForRequests(self):
# Wait until all requests are complete.