Merge "Use 'addCleanup' instead of 'tearDown' in engine(s) test"

This commit is contained in:
Jenkins
2016-02-03 21:14:06 +00:00
committed by Gerrit Code Review

View File

@@ -1505,14 +1505,15 @@ class WorkerBasedEngineTest(EngineTaskTest,
self.worker_thread = tu.daemon_thread(self.worker.run)
self.worker_thread.start()
# Ensure worker and thread is stopped when test is done; these are
# called in reverse order, so make sure we signal the stop before
# performing the join (because the reverse won't work).
self.addCleanup(self.worker_thread.join)
self.addCleanup(self.worker.stop)
# Make sure the worker is started before we can continue...
self.worker.wait()
def tearDown(self):
self.worker.stop()
self.worker_thread.join()
super(WorkerBasedEngineTest, self).tearDown()
def _make_engine(self, flow,
flow_detail=None, store=None, **kwargs):
kwargs.update(self.engine_conf)