In some rare occasions the watchdog thread is still sleeping [1] while
a test case is already finished. In this case the running thread
validation fails the test. This can be solved by not sleeping for a
fixed amount of time but instead wait the same time for a stop
event. This makes the thread stop immediately when it is asked to stop
[1] Trace
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 185, in _run
time.sleep(10)
Change-Id: I45eba5bf8f46de078fd8093719ef84e5229eafeb