Bug report
Bug description
On platforms where the forkserver start method isn't available ('forkserver' not in multiprocessing.get_all_start_methods() — e.g. any build without HAVE_SEND_HANDLE), some forkserver tests error instead of skipping:
test_concurrent_futures ProcessPoolForkserver* classes — ProcessPoolForkserverMixin.get_context() calls multiprocessing.get_context('forkserver'), which raises ValueError: cannot find context for 'forkserver'.
test_concurrent_futures.test_init.FailingInitializerResourcesTest.test_forkserver — runs the (skipped) inner test, then asserts _resource_tracker._exitcode == 0, getting None.
test_multiprocessing_forkserver.test_preload — setUp calls get_context('forkserver') directly, bypassing the setUpModule guard that the other forkserver test modules have.
(The test_processes/test_manager/test_threads modules already skip cleanly via _test_multiprocessing.setUpModule, which catches the set_start_method ValueError.)
Fix
Skip these when forkserver isn't available: guard the whole test_multiprocessing_forkserver package in its __init__.py (covers test_preload), and add "forkserver" not in multiprocessing.get_all_start_methods() skips to ProcessPoolForkserverMixin.get_context() and test_init's test_forkserver.
Related: gh-154271 (defining _XOPEN_SOURCE=600 makes forkserver available on Solaris/illumos; this issue is the independent test-robustness fix for platforms that genuinely lack it).
Linked PRs
Bug report
Bug description
On platforms where the
forkserverstart method isn't available ('forkserver' not in multiprocessing.get_all_start_methods()— e.g. any build withoutHAVE_SEND_HANDLE), some forkserver tests error instead of skipping:test_concurrent_futuresProcessPoolForkserver*classes —ProcessPoolForkserverMixin.get_context()callsmultiprocessing.get_context('forkserver'), which raisesValueError: cannot find context for 'forkserver'.test_concurrent_futures.test_init.FailingInitializerResourcesTest.test_forkserver— runs the (skipped) inner test, then asserts_resource_tracker._exitcode == 0, gettingNone.test_multiprocessing_forkserver.test_preload—setUpcallsget_context('forkserver')directly, bypassing thesetUpModuleguard that the other forkserver test modules have.(The
test_processes/test_manager/test_threadsmodules already skip cleanly via_test_multiprocessing.setUpModule, which catches theset_start_methodValueError.)Fix
Skip these when forkserver isn't available: guard the whole
test_multiprocessing_forkserverpackage in its__init__.py(coverstest_preload), and add"forkserver" not in multiprocessing.get_all_start_methods()skips toProcessPoolForkserverMixin.get_context()andtest_init'stest_forkserver.Related: gh-154271 (defining
_XOPEN_SOURCE=600makes forkserver available on Solaris/illumos; this issue is the independent test-robustness fix for platforms that genuinely lack it).Linked PRs