Browse Source

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
changes/72/79472/1
James E. Blair 8 years ago
parent
commit
491b3173d7
  1. 2
      tests/test_scheduler.py

2
tests/test_scheduler.py

@ -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)

Loading…
Cancel
Save