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.
This commit is contained in:
Victor Stinner 2018-06-27 18:18:10 +02:00 committed by GitHub
parent 74e4aee549
commit fbd7172325
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -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()