[Python-checkins] bpo-30356: Fix test_mymanager_context() of multiprocessing (GH-7968)

Miss Islington (bot) webhook-mailer at python.org
Wed Jun 27 12:45:04 EDT 2018


https://github.com/python/cpython/commit/a599323fc7661668a01e9fbb0d2369e62941bdf1
commit: a599323fc7661668a01e9fbb0d2369e62941bdf1
branch: 3.6
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: GitHub <noreply at github.com>
date: 2018-06-27T09:45:01-07:00
summary:

bpo-30356: Fix test_mymanager_context() of multiprocessing (GH-7968)


test_mymanager_context() now also accepts -SIGTERM as an expected
exitcode for the manager process. The process is killed with SIGTERM
if it takes longer than 1 second to stop.
(cherry picked from commit fbd7172325e6ce55b6d5d3d7603e4c1c8a219cb8)

Co-authored-by: Victor Stinner <vstinner at redhat.com>

files:
M Lib/test/_test_multiprocessing.py

diff --git a/Lib/test/_test_multiprocessing.py b/Lib/test/_test_multiprocessing.py
index 3fa45b678733..e0edff419231 100644
--- a/Lib/test/_test_multiprocessing.py
+++ b/Lib/test/_test_multiprocessing.py
@@ -2400,7 +2400,9 @@ def test_mymanager(self):
     def test_mymanager_context(self):
         with MyManager() as manager:
             self.common(manager)
-        self.assertEqual(manager._process.exitcode, 0)
+        # bpo-30356: BaseManager._finalize_manager() sends SIGTERM
+        # to the manager process if it takes longer than 1 second to stop.
+        self.assertIn(manager._process.exitcode, (0, -signal.SIGTERM))
 
     def test_mymanager_context_prestarted(self):
         manager = MyManager()



More information about the Python-checkins mailing list