[pytest-dev] multiprocessing tests hang on Python3.8+macOS
Andrew Nelson
andyfaff at gmail.com
Sat Apr 11 00:53:09 EDT 2020
A gist showing the test hanging is here:
https://gist.github.com/andyfaff/a5bb1cbcc1828edde0bc7c1f67666f1c
Note that if the Pool start method is set to 'fork' (non default on macOS
and not recommended) then the test runs without any issues.
On Sat, 11 Apr 2020 at 14:23, Andrew Nelson <andyfaff at gmail.com> wrote:
> Dear pytest-dev,
> on scipy we typically run the test suite using a test script collecting a
> series of test arguments, then supplies them to `pytest.main()`.
>
> https://github.com/scipy/scipy/blob/master/runtests.py#L307
> then
> https://github.com/scipy/scipy/blob/master/scipy/_lib/_testutils.py#L67
>
> I'm finding that all the tests that involve multiprocessing fail, e.g.
>
> ```
> def test_pool():
> with Pool(2) as p:
> p.map(math.sin, [1,2,3, 4])
> ```
>
> This is on macOS+Python3.8 that uses 'spawn' as a start method. If I run
> the tests directly using pytest there aren't any issues.
> Are there any known issues using `pytest.main` with multiprocessing?
>
> Andrew
>
--
_____________________________________
Dr. Andrew Nelson
_____________________________________
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pytest-dev/attachments/20200411/4863fefd/attachment.html>
More information about the pytest-dev
mailing list