summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2019-09-24 05:39:47 -0700
committerGitHub <noreply@github.com>2019-09-24 05:39:47 -0700
commit081641fe520382d48ffead158ab528180f72017d (patch)
tree762d51cea806a5a558becebf304fd19a084b2fd0
parentfea9ca1b0c6279f483a73f2040b068dd0e0d3acd (diff)
downloadcpython-git-081641fe520382d48ffead158ab528180f72017d.tar.gz
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 b0e1ae5f5430433766e023c1a6936aeba0f2b84e) Co-authored-by: Victor Stinner <vstinner@redhat.com>
-rw-r--r--Lib/test/_test_multiprocessing.py11
-rw-r--r--Misc/NEWS.d/next/Tests/2019-09-24-12-30-55.bpo-37123.IoutBn.rst4
2 files changed, 10 insertions, 5 deletions
diff --git a/Lib/test/_test_multiprocessing.py b/Lib/test/_test_multiprocessing.py
index 0de350c5c6..1474624ac5 100644
--- a/Lib/test/_test_multiprocessing.py
+++ b/Lib/test/_test_multiprocessing.py
@@ -2799,16 +2799,17 @@ class _TestMyManager(BaseTestCase):
self.common(manager)
manager.shutdown()
- # If the manager process exited cleanly then the exitcode
- # will be zero. Otherwise (after a short timeout)
- # terminate() is used, resulting in an exitcode of -SIGTERM.
- 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,
+ # which happens on slow buildbots.
+ self.assertIn(manager._process.exitcode, (0, -signal.SIGTERM))
def test_mymanager_context(self):
with MyManager() as manager:
self.common(manager)
# bpo-30356: BaseManager._finalize_manager() sends SIGTERM
- # to the manager process if it takes longer than 1 second to stop.
+ # to the manager process if it takes longer than 1 second to stop,
+ # which happens on slow buildbots.
self.assertIn(manager._process.exitcode, (0, -signal.SIGTERM))
def test_mymanager_context_prestarted(self):
diff --git a/Misc/NEWS.d/next/Tests/2019-09-24-12-30-55.bpo-37123.IoutBn.rst b/Misc/NEWS.d/next/Tests/2019-09-24-12-30-55.bpo-37123.IoutBn.rst
new file mode 100644
index 0000000000..200a5c324d
--- /dev/null
+++ b/Misc/NEWS.d/next/Tests/2019-09-24-12-30-55.bpo-37123.IoutBn.rst
@@ -0,0 +1,4 @@
+Multiprocessing test test_mymanager() now also expects -SIGTERM, not only
+exitcode 0. BaseManager._finalize_manager() sends SIGTERM to the manager
+process if it takes longer than 1 second to stop, which happens on slow
+buildbots.