diff options
author | Victor Stinner <vstinner@redhat.com> | 2018-06-27 16:18:10 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-27 16:18:10 (GMT) |
commit | fbd7172325e6ce55b6d5d3d7603e4c1c8a219cb8 (patch) | |
tree | 7ee368fd4a320f3f491fc494e56f0ea4fbf76daf | |
parent | 74e4aee54982bf8b3d1d1cdce965cf0e03e88e34 (diff) | |
download | cpython-fbd7172325e6ce55b6d5d3d7603e4c1c8a219cb8.zip cpython-fbd7172325e6ce55b6d5d3d7603e4c1c8a219cb8.tar.gz cpython-fbd7172325e6ce55b6d5d3d7603e4c1c8a219cb8.tar.bz2 |
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.
-rw-r--r-- | Lib/test/_test_multiprocessing.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/test/_test_multiprocessing.py b/Lib/test/_test_multiprocessing.py index 424e1fa..5d094f9 100644 --- a/Lib/test/_test_multiprocessing.py +++ b/Lib/test/_test_multiprocessing.py @@ -2666,7 +2666,9 @@ class _TestMyManager(BaseTestCase): 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() |