mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
bpo-17258: Add requires_hashdigest to multiprocessing tests (GH-20412)
Skip some :mod:`multiprocessing` tests when MD5 hash digest is blocked.
Signed-off-by: Christian Heimes <christian@python.org>
(cherry picked from commit b022e5cffb
)
Co-authored-by: Christian Heimes <christian@python.org>
This commit is contained in:
parent
6d62dc1ea4
commit
196810a98a
3 changed files with 13 additions and 0 deletions
|
@ -26,6 +26,7 @@ import warnings
|
||||||
import test.support
|
import test.support
|
||||||
import test.support.script_helper
|
import test.support.script_helper
|
||||||
from test import support
|
from test import support
|
||||||
|
from test.support import hashlib_helper
|
||||||
from test.support import socket_helper
|
from test.support import socket_helper
|
||||||
|
|
||||||
|
|
||||||
|
@ -2953,6 +2954,8 @@ class _TestRemoteManager(BaseTestCase):
|
||||||
# Make queue finalizer run before the server is stopped
|
# Make queue finalizer run before the server is stopped
|
||||||
del queue
|
del queue
|
||||||
|
|
||||||
|
|
||||||
|
@hashlib_helper.requires_hashdigest('md5')
|
||||||
class _TestManagerRestart(BaseTestCase):
|
class _TestManagerRestart(BaseTestCase):
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
@ -3437,6 +3440,7 @@ class _TestPoll(BaseTestCase):
|
||||||
#
|
#
|
||||||
|
|
||||||
@unittest.skipUnless(HAS_REDUCTION, "test needs multiprocessing.reduction")
|
@unittest.skipUnless(HAS_REDUCTION, "test needs multiprocessing.reduction")
|
||||||
|
@hashlib_helper.requires_hashdigest('md5')
|
||||||
class _TestPicklingConnections(BaseTestCase):
|
class _TestPicklingConnections(BaseTestCase):
|
||||||
|
|
||||||
ALLOWED_TYPES = ('processes',)
|
ALLOWED_TYPES = ('processes',)
|
||||||
|
@ -3739,6 +3743,7 @@ class _TestSharedCTypes(BaseTestCase):
|
||||||
|
|
||||||
|
|
||||||
@unittest.skipUnless(HAS_SHMEM, "requires multiprocessing.shared_memory")
|
@unittest.skipUnless(HAS_SHMEM, "requires multiprocessing.shared_memory")
|
||||||
|
@hashlib_helper.requires_hashdigest('md5')
|
||||||
class _TestSharedMemory(BaseTestCase):
|
class _TestSharedMemory(BaseTestCase):
|
||||||
|
|
||||||
ALLOWED_TYPES = ('processes',)
|
ALLOWED_TYPES = ('processes',)
|
||||||
|
@ -4414,6 +4419,7 @@ class TestInvalidHandle(unittest.TestCase):
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@hashlib_helper.requires_hashdigest('md5')
|
||||||
class OtherTest(unittest.TestCase):
|
class OtherTest(unittest.TestCase):
|
||||||
# TODO: add more tests for deliver/answer challenge.
|
# TODO: add more tests for deliver/answer challenge.
|
||||||
def test_deliver_challenge_auth_failure(self):
|
def test_deliver_challenge_auth_failure(self):
|
||||||
|
@ -4450,6 +4456,7 @@ class OtherTest(unittest.TestCase):
|
||||||
def initializer(ns):
|
def initializer(ns):
|
||||||
ns.test += 1
|
ns.test += 1
|
||||||
|
|
||||||
|
@hashlib_helper.requires_hashdigest('md5')
|
||||||
class TestInitializers(unittest.TestCase):
|
class TestInitializers(unittest.TestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
self.mgr = multiprocessing.Manager()
|
self.mgr = multiprocessing.Manager()
|
||||||
|
@ -5304,6 +5311,7 @@ class TestPoolNotLeakOnFailure(unittest.TestCase):
|
||||||
any(process.is_alive() for process in forked_processes))
|
any(process.is_alive() for process in forked_processes))
|
||||||
|
|
||||||
|
|
||||||
|
@hashlib_helper.requires_hashdigest('md5')
|
||||||
class TestSyncManagerTypes(unittest.TestCase):
|
class TestSyncManagerTypes(unittest.TestCase):
|
||||||
"""Test all the types which can be shared between a parent and a
|
"""Test all the types which can be shared between a parent and a
|
||||||
child process by using a manager which acts as an intermediary
|
child process by using a manager which acts as an intermediary
|
||||||
|
@ -5698,6 +5706,8 @@ def install_tests_in_module_dict(remote_globs, start_method):
|
||||||
Mixin = local_globs[type_.capitalize() + 'Mixin']
|
Mixin = local_globs[type_.capitalize() + 'Mixin']
|
||||||
class Temp(base, Mixin, unittest.TestCase):
|
class Temp(base, Mixin, unittest.TestCase):
|
||||||
pass
|
pass
|
||||||
|
if type_ == 'manager':
|
||||||
|
Temp = hashlib_helper.requires_hashdigest('md5')(Temp)
|
||||||
Temp.__name__ = Temp.__qualname__ = newname
|
Temp.__name__ = Temp.__qualname__ = newname
|
||||||
Temp.__module__ = __module__
|
Temp.__module__ = __module__
|
||||||
remote_globs[newname] = Temp
|
remote_globs[newname] = Temp
|
||||||
|
|
|
@ -5,6 +5,7 @@ support.import_module('_multiprocessing')
|
||||||
# Skip tests if sem_open implementation is broken.
|
# Skip tests if sem_open implementation is broken.
|
||||||
support.import_module('multiprocessing.synchronize')
|
support.import_module('multiprocessing.synchronize')
|
||||||
|
|
||||||
|
from test.support import hashlib_helper
|
||||||
from test.support.script_helper import assert_python_ok
|
from test.support.script_helper import assert_python_ok
|
||||||
|
|
||||||
import contextlib
|
import contextlib
|
||||||
|
@ -952,6 +953,7 @@ class ProcessPoolExecutorTest(ExecutorTest):
|
||||||
self.assertIn('raise RuntimeError(123) # some comment',
|
self.assertIn('raise RuntimeError(123) # some comment',
|
||||||
f1.getvalue())
|
f1.getvalue())
|
||||||
|
|
||||||
|
@hashlib_helper.requires_hashdigest('md5')
|
||||||
def test_ressources_gced_in_workers(self):
|
def test_ressources_gced_in_workers(self):
|
||||||
# Ensure that argument for a job are correctly gc-ed after the job
|
# Ensure that argument for a job are correctly gc-ed after the job
|
||||||
# is finished
|
# is finished
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
Skip some :mod:`multiprocessing` tests when MD5 hash digest is blocked.
|
Loading…
Add table
Add a link
Reference in a new issue