Add missing thread joins to tests

We miss joins on the executor_server and merge_server after stopping
them. This causes occasional test failures because a thread is still
running [1].

[1] Thread dump:
Thread: 139647061567232
  File "/usr/lib/python3.5/threading.py", line 882, in _bootstrap
    self._bootstrap_inner()
  File "/usr/lib/python3.5/threading.py", line 914, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.5/threading.py", line 862, in run
    self._target(*self._args, **self._kwargs)
  File "/home/zuul/src/git.openstack.org/openstack-infra/zuul/zuul/executor/server.py", line 2488, in _updateLoop
    self._innerUpdateLoop()
  File "/home/zuul/src/git.openstack.org/openstack-infra/zuul/zuul/executor/server.py", line 2496, in _innerUpdateLoop
    task = self.update_queue.get()
  File "/home/zuul/src/git.openstack.org/openstack-infra/zuul/zuul/executor/server.py", line 563, in get
    self.condition.wait()
  File "/usr/lib/python3.5/threading.py", line 293, in wait
    waiter.acquire()

Change-Id: I0f4909a37f89957d94ff6d92c61b0522ec40a1d8
This commit is contained in:
Tobias Henkel 2019-03-23 08:12:57 +01:00
parent 25572fff82
commit 7c77586582
No known key found for this signature in database
GPG Key ID: 03750DEC158E5FA2
1 changed files with 2 additions and 0 deletions

View File

@ -2909,7 +2909,9 @@ class ZuulTestCase(BaseTestCase):
self.merge_client.stop()
if self.merge_server:
self.merge_server.stop()
self.merge_server.join()
self.executor_server.stop()
self.executor_server.join()
self.sched.stop()
self.sched.join()
self.statsd.stop()