@@ -1431,6 +1431,7 @@ def _acquire_event(lock, event):
1431
1431
event .set ()
1432
1432
time .sleep (1.0 )
1433
1433
1434
+ @hashlib_helper .requires_hashdigest ('sha256' ) # Manager RPC connection auth
1434
1435
def test_repr_lock (self ):
1435
1436
if self .TYPE != 'processes' :
1436
1437
self .skipTest ('test not appropriate for {}' .format (self .TYPE ))
@@ -1496,6 +1497,7 @@ def _acquire_release(lock, timeout, l=None, n=1):
1496
1497
for _ in range (n ):
1497
1498
lock .release ()
1498
1499
1500
+ @hashlib_helper .requires_hashdigest ('sha256' ) # Manager RPC connection auth
1499
1501
def test_repr_rlock (self ):
1500
1502
if self .TYPE != 'processes' :
1501
1503
self .skipTest ('test not appropriate for {}' .format (self .TYPE ))
@@ -3417,6 +3419,7 @@ def tearDown(self):
3417
3419
self .mgr .shutdown ()
3418
3420
self .mgr .join ()
3419
3421
3422
+ @hashlib_helper .requires_hashdigest ('sha256' ) # multiprocessing.connection
3420
3423
def test_queue_get (self ):
3421
3424
queue = self .mgr .Queue ()
3422
3425
if gc .isenabled ():
@@ -3730,6 +3733,7 @@ def test_context(self):
3730
3733
if self .TYPE == 'processes' :
3731
3734
self .assertRaises (OSError , l .accept )
3732
3735
3736
+ @hashlib_helper .requires_hashdigest ('sha256' ) # connection auth
3733
3737
def test_empty_authkey (self ):
3734
3738
# bpo-43952: allow empty bytes as authkey
3735
3739
def handler (* args ):
@@ -5782,9 +5786,11 @@ def test_get_all_start_methods(self):
5782
5786
self .assertIn (methods [0 ], {'forkserver' , 'spawn' },
5783
5787
msg = '3.14+ default must not be fork' )
5784
5788
if methods [0 ] == 'spawn' :
5785
- # Confirm that the current default selection logic prefers
5786
- # forkserver vs spawn when available.
5787
- self .assertNotIn ('forkserver' , methods )
5789
+ if not hashlib_helper .in_openssl_fips_mode ():
5790
+ # Confirm that the current default selection logic prefers
5791
+ # forkserver vs spawn when available.
5792
+ # OpenSSL FIPS mode can disable this by blocking sha256.
5793
+ self .assertNotIn ('forkserver' , methods )
5788
5794
5789
5795
def test_preload_resources (self ):
5790
5796
if multiprocessing .get_start_method () != 'forkserver' :
@@ -5805,7 +5811,11 @@ def test_mixed_startmethod(self):
5805
5811
# Fork-based locks cannot be used with spawned process
5806
5812
for process_method in ["spawn" , "forkserver" ]:
5807
5813
queue = multiprocessing .get_context ("fork" ).Queue ()
5808
- process_ctx = multiprocessing .get_context (process_method )
5814
+ try :
5815
+ process_ctx = multiprocessing .get_context (process_method )
5816
+ except ValueError as err :
5817
+ self .skipTest (err )
5818
+ continue
5809
5819
p = process_ctx .Process (target = close_queue , args = (queue ,))
5810
5820
err_msg = "A SemLock created in a fork"
5811
5821
with self .assertRaisesRegex (RuntimeError , err_msg ):
@@ -5814,8 +5824,13 @@ def test_mixed_startmethod(self):
5814
5824
# non-fork-based locks can be used with all other start methods
5815
5825
for queue_method in ["spawn" , "forkserver" ]:
5816
5826
for process_method in multiprocessing .get_all_start_methods ():
5817
- queue = multiprocessing .get_context (queue_method ).Queue ()
5818
- process_ctx = multiprocessing .get_context (process_method )
5827
+ try :
5828
+ queue_ctx = multiprocessing .get_context (queue_method )
5829
+ process_ctx = multiprocessing .get_context (process_method )
5830
+ except ValueError as err :
5831
+ self .skipTest (err )
5832
+ continue
5833
+ queue = queue_ctx .Queue ()
5819
5834
p = process_ctx .Process (target = close_queue , args = (queue ,))
5820
5835
p .start ()
5821
5836
p .join ()
0 commit comments