diff options
author | Asheesh Laroia <github@asheesh.org> | 2021-02-07 19:15:51 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-08 03:15:51 +0000 |
commit | bf2e7e55d7306b1e2fce7dce767e8df5ff42cf1c (patch) | |
tree | f6372786f3d6ca7add303f58671c44de0f7b34f7 /Misc | |
parent | bpo-43147: Remove archaic terminology. (GH-24462) (diff) | |
download | cpython-bf2e7e55d7306b1e2fce7dce767e8df5ff42cf1c.tar.gz cpython-bf2e7e55d7306b1e2fce7dce767e8df5ff42cf1c.tar.bz2 cpython-bf2e7e55d7306b1e2fce7dce767e8df5ff42cf1c.zip |
bpo-40692: Run more test_concurrent_futures tests (GH-20239)
In the case of multiprocessing.synchronize() being missing, the
test_concurrent_futures test suite now skips only the tests that
require multiprocessing.synchronize().
Validate that multiprocessing.synchronize exists as part of
_check_system_limits(), allowing ProcessPoolExecutor to raise
NotImplementedError during __init__, rather than crashing with
ImportError during __init__ when creating a lock imported from
multiprocessing.synchronize.
Use _check_system_limits() to disable tests of
ProcessPoolExecutor on systems without multiprocessing.synchronize.
Running the test suite without multiprocessing.synchronize reveals
that Lib/compileall.py crashes when it uses a ProcessPoolExecutor.
Therefore, change Lib/compileall.py to call _check_system_limits()
before creating the ProcessPoolExecutor.
Note that both Lib/compileall.py and Lib/test/test_compileall.py
were attempting to sanity-check ProcessPoolExecutor by expecting
ImportError. In multiprocessing.resource_tracker, sem_unlink() is also absent
on platforms where POSIX semaphores aren't available. Avoid using
sem_unlink() if it, too, does not exist.
Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
Diffstat (limited to 'Misc')
-rw-r--r-- | Misc/NEWS.d/next/Core and Builtins/2020-05-19-22-10-05.bpo-40692.ajEhrR.rst | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-05-19-22-10-05.bpo-40692.ajEhrR.rst b/Misc/NEWS.d/next/Core and Builtins/2020-05-19-22-10-05.bpo-40692.ajEhrR.rst new file mode 100644 index 00000000000..b92dcdd00af --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2020-05-19-22-10-05.bpo-40692.ajEhrR.rst @@ -0,0 +1 @@ +In the :class:`concurrent.futures.ProcessPoolExecutor`, validate that :func:`multiprocess.synchronize` is available on a given platform and rely on that check in the :mod:`concurrent.futures` test suite so we can run tests that are unrelated to :class:`ProcessPoolExecutor` on those platforms. |