Whitelist watchdog threads in test thread leak checker

The watchdog threads check their status every 10 seconds which means
they can only exit as quickly as once every 10 seconds. This results in
the threads appearing to be leaked by tests but they should go away in
no more than 10 seconds.

Note that we don't reduce this poll time as there could be many watchdog
threads running during normal zuul execution and typically 10 second
resolution there is plenty. We just have to accomodate that in our
tests.

Change-Id: If3cf86c4af0b2fbcaf51a233c766c75749ca1d1d
diff --git a/tests/base.py b/tests/base.py
index 2f07b1d..7a39e20 100755
--- a/tests/base.py
+++ b/tests/base.py
@@ -1654,7 +1654,10 @@
         self.gearman_server.shutdown()
         self.fake_nodepool.stop()
         self.zk.disconnect()
-        threads = threading.enumerate()
+        # we whitelist watchdog threads as they have relatively long delays
+        # before noticing they should exit, but they should exit on their own.
+        threads = [t for t in threading.enumerate()
+                   if t.name != 'executor-watchdog']
         if len(threads) > 1:
             self.log.error("More than one thread is running: %s" % threads)
         self.printHistory()
diff --git a/zuul/executor/server.py b/zuul/executor/server.py
index 2658556..571f3ee 100644
--- a/zuul/executor/server.py
+++ b/zuul/executor/server.py
@@ -46,7 +46,8 @@
         self.timeout = timeout
         self.function = function
         self.args = args
-        self.thread = threading.Thread(target=self._run)
+        self.thread = threading.Thread(target=self._run,
+                                       name='executor-watchdog')
         self.thread.daemon = True
         self.timed_out = None