Skip to content

Commit b0e1ae5

Browse files
authored
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.
1 parent 99799c7 commit b0e1ae5

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
@@ -2799,16 +2799,17 @@ def test_mymanager(self):
27992799
self.common(manager)
28002800
manager.shutdown()
28012801

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

28072807
def test_mymanager_context(self):
28082808
with MyManager() as manager:
28092809
self.common(manager)
28102810
# bpo-30356: BaseManager._finalize_manager() sends SIGTERM
2811-
# to the manager process if it takes longer than 1 second to stop.
2811+
# to the manager process if it takes longer than 1 second to stop,
2812+
# which happens on slow buildbots.
28122813
self.assertIn(manager._process.exitcode, (0, -signal.SIGTERM))
28132814

28142815
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)