From: JINMEI Tatuya Date: Wed, 8 May 2013 07:16:11 +0000 (-0700) Subject: [2823-regression] shutdown MyStatsHttpd running on a separate thread X-Git-Tag: bind10-1.2.0beta1-release~463^2~4 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5fcf58d12137139ba41af390550a0b73ea8a9ef3;p=thirdparty%2Fkea.git [2823-regression] shutdown MyStatsHttpd running on a separate thread 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) --- diff --git a/src/bin/stats/tests/stats-httpd_test.py b/src/bin/stats/tests/stats-httpd_test.py index a61ee47425..a37302d8bc 100644 --- a/src/bin/stats/tests/stats-httpd_test.py +++ b/src/bin/stats/tests/stats-httpd_test.py @@ -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() diff --git a/src/bin/stats/tests/test_utils.py b/src/bin/stats/tests/test_utils.py index 8886ad2184..93d7d6bddf 100644 --- a/src/bin/stats/tests/test_utils.py +++ b/src/bin/stats/tests/test_utils.py @@ -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)