From: Victor Stinner Date: Mon, 24 Jul 2017 11:02:20 +0000 (+0200) Subject: bpo-26762: Avoid daemon process in _test_multiprocessing (#2842) X-Git-Tag: v3.7.0a1~380 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=06634950c553f8df83330ed468c11483b857b7dc;p=python bpo-26762: Avoid daemon process in _test_multiprocessing (#2842) test_level() of _test_multiprocessing._TestLogging now uses regular processes rather than daemon processes to prevent zombi processes (to not "leak" processes). --- diff --git a/Lib/test/_test_multiprocessing.py b/Lib/test/_test_multiprocessing.py index a14fa7422e..88e2eb3dac 100644 --- a/Lib/test/_test_multiprocessing.py +++ b/Lib/test/_test_multiprocessing.py @@ -3469,16 +3469,18 @@ class _TestLogging(BaseTestCase): logger.setLevel(LEVEL1) p = self.Process(target=self._test_level, args=(writer,)) - p.daemon = True p.start() self.assertEqual(LEVEL1, reader.recv()) + p.join() + p.close() logger.setLevel(logging.NOTSET) root_logger.setLevel(LEVEL2) p = self.Process(target=self._test_level, args=(writer,)) - p.daemon = True p.start() self.assertEqual(LEVEL2, reader.recv()) + p.join() + p.close() root_logger.setLevel(root_level) logger.setLevel(level=LOG_LEVEL)