]> granicus.if.org Git - python/commitdiff
bpo-26762: Avoid daemon process in _test_multiprocessing (#2842)
authorVictor Stinner <victor.stinner@gmail.com>
Mon, 24 Jul 2017 11:02:20 +0000 (13:02 +0200)
committerGitHub <noreply@github.com>
Mon, 24 Jul 2017 11:02:20 +0000 (13:02 +0200)
test_level() of _test_multiprocessing._TestLogging now uses regular
processes rather than daemon processes to prevent zombi processes
(to not "leak" processes).

Lib/test/_test_multiprocessing.py

index a14fa7422e7fab679ad08dd47dc3827b73faaf9a..88e2eb3dac18661cf34de5d3a628a3ad105e7129 100644 (file)
@@ -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)