Skip to content

Commit ccb382f

Browse files
committed
Specified failures on rapid test
1 parent 6281a3b commit ccb382f

File tree

1 file changed

+32
-1
lines changed

1 file changed

+32
-1
lines changed

Lib/test/_test_multiprocessing.py

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6715,6 +6715,33 @@ class ThreadsMixin(BaseMixin):
67156715
# Functions used to create test cases from the base ones in this module
67166716
#
67176717

6718+
6719+
def get_temp_class(test_name, module, base, Mixin, type_):
6720+
# RUSTPYTHON specific function to define the Temp class
6721+
6722+
# test_rapid_restart fails on:
6723+
# - 'test_multiprocessing_fork' in 'WithManagerTestManagerRestart' test, on windows and mac
6724+
# - 'test_multiprocessing_forkserver' in 'WithManagerTestManagerRestart' test on windows
6725+
# - `test_multiprocessing_spawn` in 'WithManagerTestManagerRestart' test on windows
6726+
if (
6727+
test_name == 'WithManagerTestManagerRestart' and
6728+
(
6729+
sys.platform == "win32" or
6730+
(sys.platform == "darwin" and 'test_multiprocessing_fork' in module)
6731+
)
6732+
):
6733+
class Temp(base, Mixin, unittest.TestCase):
6734+
@unittest.expectedFailure #TODO: RUSTPYTHON
6735+
def test_rapid_restart(self):
6736+
super().test_rapid_restart()
6737+
6738+
else:
6739+
class Temp(base, Mixin, unittest.TestCase):
6740+
pass
6741+
if type_ == 'manager':
6742+
Temp = hashlib_helper.requires_hashdigest('sha256')(Temp)
6743+
return Temp
6744+
67186745
def install_tests_in_module_dict(remote_globs, start_method,
67196746
only_type=None, exclude_types=False):
67206747
__module__ = remote_globs['__name__']
@@ -6737,7 +6764,11 @@ def install_tests_in_module_dict(remote_globs, start_method,
67376764
continue
67386765
newname = 'With' + type_.capitalize() + name[1:]
67396766
Mixin = local_globs[type_.capitalize() + 'Mixin']
6740-
if newname == "WithManagerTestManagerRestart":
6767+
if (newname == 'WithManagerTestManagerRestart' and
6768+
(
6769+
sys.platform == "win32" or
6770+
(sys.platform == "darwin" and '.test_multiprocessing_fork.' in __module__)
6771+
)):
67416772
class Temp(base, Mixin, unittest.TestCase):
67426773
@unittest.expectedFailure #TODO: RUSTPYTHON
67436774
def test_rapid_restart(self):

0 commit comments

Comments
 (0)