[Python-checkins] bpo-26762: Avoid daemon process in _test_multiprocessing (#2842)
Victor Stinner
webhook-mailer at python.org
Mon Jul 24 07:02:23 EDT 2017
https://github.com/python/cpython/commit/06634950c553f8df83330ed468c11483b857b7dc
commit: 06634950c553f8df83330ed468c11483b857b7dc
branch: master
author: Victor Stinner <victor.stinner at gmail.com>
committer: GitHub <noreply at github.com>
date: 2017-07-24T13:02:20+02:00
summary:
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).
files:
M Lib/test/_test_multiprocessing.py
diff --git a/Lib/test/_test_multiprocessing.py b/Lib/test/_test_multiprocessing.py
index a14fa7422e7..88e2eb3dac1 100644
--- a/Lib/test/_test_multiprocessing.py
+++ b/Lib/test/_test_multiprocessing.py
@@ -3469,16 +3469,18 @@ def test_level(self):
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)
More information about the Python-checkins
mailing list