Shut down the gearman server last in tests

In particular, shut it down after all its clients have been shut
down.  In some cases, it was shut down early enough that the RPC
listener was able to attempt to reconnect to it and trigger a
rare condition in gear that would cause the reconnection thread
to hang.

Change-Id: I1dc5d77484eabf9fa43f16ae8295ddb4df4af056
This commit is contained in:
James E. Blair 2014-03-10 15:05:36 -07:00
parent ac6c77d06b
commit 491b3173d7
1 changed files with 1 additions and 1 deletions

View File

@ -896,7 +896,6 @@ class TestScheduler(testtools.TestCase):
self.merge_server.join()
self.merge_client.stop()
self.worker.shutdown()
self.gearman_server.shutdown()
self.gerrit.stop()
self.timer.stop()
self.sched.stop()
@ -907,6 +906,7 @@ class TestScheduler(testtools.TestCase):
self.webapp.join()
self.rpc.stop()
self.rpc.join()
self.gearman_server.shutdown()
threads = threading.enumerate()
if len(threads) > 1:
self.log.error("More than one thread is running: %s" % threads)