File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1111
1212from test import support
1313from test .support import threading_helper
14+ import warnings
1415
1516
1617def create_future (state = PENDING , exception = None , result = None ):
@@ -51,7 +52,15 @@ def setUp(self):
5152 max_workers = self .worker_count ,
5253 mp_context = self .get_context (),
5354 ** self .executor_kwargs )
54- self .manager = self .get_context ().Manager ()
55+ # gh-135427
56+ # In some of the tests, a forked child forks another child of itself. In that case, using
57+ # warnings_helper.ignore_warnings decorator does not actually ignore the warning from that
58+ # child of child, and a warnings_helper.ignore_warnings exception is raised.
59+ with warnings .catch_warnings ():
60+ warnings .filterwarnings ('ignore' ,
61+ message = ".*fork.*may lead to deadlocks in the child.*" ,
62+ category = DeprecationWarning )
63+ self .manager = self .get_context ().Manager ()
5564 else :
5665 self .executor = self .executor_type (
5766 max_workers = self .worker_count ,
Original file line number Diff line number Diff line change @@ -730,6 +730,7 @@ def remove_loop(fname, tries):
730730 # based on os.fork existing because that is what users and this test use.
731731 # This helps ensure that when fork exists (the important concept) that the
732732 # register_at_fork mechanism is also present and used.
733+ @warnings_helper .ignore_warnings (category = DeprecationWarning ) # gh-135427
733734 @support .requires_fork ()
734735 @threading_helper .requires_working_threading ()
735736 @skip_if_asan_fork
@@ -4067,6 +4068,7 @@ def test_config_reject_simple_queue_handler_multiprocessing_context(self):
40674068 with self .assertRaises (ValueError ):
40684069 self ._apply_simple_queue_listener_configuration (qspec )
40694070
4071+ @warnings_helper .ignore_warnings (category = DeprecationWarning ) # gh-135427
40704072 @skip_if_tsan_fork
40714073 @support .requires_subprocess ()
40724074 @unittest .skipUnless (support .Py_DEBUG , "requires a debug build for testing"
You can’t perform that action at this time.
0 commit comments