]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[2823-regression] shutdown MyStatsHttpd running on a separate thread
authorJINMEI Tatuya <jinmei@isc.org>
Wed, 8 May 2013 07:16:11 +0000 (00:16 -0700)
committerJINMEI Tatuya <jinmei@isc.org>
Wed, 8 May 2013 07:16:11 +0000 (00:16 -0700)
the dangling threads do not necessarily do harm (test failure, etc),
but show confusing behaviors such as leaked exception.  explicit shutdown
should prevent these (for a longer term, we should really stop using threads
for the http-handler tests)

src/bin/stats/tests/stats-httpd_test.py
src/bin/stats/tests/test_utils.py

index a61ee474252ab00efc2bd4ce1317e795761cac6c..a37302d8bc02abe66e040beca9b9dce708af3680 100644 (file)
@@ -248,6 +248,7 @@ class TestHttpHandler(unittest.TestCase):
 
     def tearDown(self):
         self.client.close()
+        self.stats_httpd_server.shutdown()
         # reset the signal handler
         self.sig_handler.reset()
 
index 8886ad2184925b6a27b2dc5e92a79188561eb588..93d7d6bddfdeef071d193c733ee5c9c027cbc00d 100644 (file)
@@ -562,3 +562,6 @@ class MyStatsHttpd(stats_httpd.StatsHttpd):
     def run(self):
         self._started.set()
         self.start()
+
+    def shutdown(self):
+        self.command_handler('shutdown', None)