Skip to content

Commit 46f6c56

Browse files
bpo-37123: multiprocessing test_mymanager() accepts SIGTERM (GH-16349)
Multiprocessing test test_mymanager() now also expects -SIGTERM, not only exitcode 0. bpo-30356: BaseManager._finalize_manager() sends SIGTERM to the manager process if it takes longer than 1 second to stop, which happens on slow buildbots. (cherry picked from commit b0e1ae5) Co-authored-by: Victor Stinner <[email protected]>
1 parent c13a4d6 commit 46f6c56

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

Lib/test/_test_multiprocessing.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2689,16 +2689,17 @@ def test_mymanager(self):
26892689
self.common(manager)
26902690
manager.shutdown()
26912691

2692-
# If the manager process exited cleanly then the exitcode
2693-
# will be zero. Otherwise (after a short timeout)
2694-
# terminate() is used, resulting in an exitcode of -SIGTERM.
2695-
self.assertEqual(manager._process.exitcode, 0)
2692+
# bpo-30356: BaseManager._finalize_manager() sends SIGTERM
2693+
# to the manager process if it takes longer than 1 second to stop,
2694+
# which happens on slow buildbots.
2695+
self.assertIn(manager._process.exitcode, (0, -signal.SIGTERM))
26962696

26972697
def test_mymanager_context(self):
26982698
with MyManager() as manager:
26992699
self.common(manager)
27002700
# bpo-30356: BaseManager._finalize_manager() sends SIGTERM
2701-
# to the manager process if it takes longer than 1 second to stop.
2701+
# to the manager process if it takes longer than 1 second to stop,
2702+
# which happens on slow buildbots.
27022703
self.assertIn(manager._process.exitcode, (0, -signal.SIGTERM))
27032704

27042705
def test_mymanager_context_prestarted(self):
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Multiprocessing test test_mymanager() now also expects -SIGTERM, not only
2+
exitcode 0. BaseManager._finalize_manager() sends SIGTERM to the manager
3+
process if it takes longer than 1 second to stop, which happens on slow
4+
buildbots.

0 commit comments

Comments
 (0)