Repository navigation
Open
Labels
Description
Hi,
I am using Pathos to do multiprocessing with objects containing lambda functions. When I run my tests, Pathos doesn't return although tests complete successfully:
(go-ast-go-EjGnZ3Kb-py3.8) ~/P/project (master|●3✚1…) $ pytest . 13:31:38
=============================================================================== test session starts ================================================================================
platform darwin -- Python 3.8.1+, pytest-5.3.5, py-1.8.1, pluggy-0.13.1
rootdir: /Users/username/PycharmProjects/project
plugins: timeout-1.3.4
collected 14 items
tests/test_compare.py . [ 7%]
tests/test_continuous.py ... [ 28%]
tests/test_problem.py . [ 35%]
tests/test_solution.py . [ 42%]
tests/test_solver.py .. [ 57%]
tests/test_tsp.py ...... [100%]
================================================================================ 14 passed in 0.54s ================================================================================
^[[A
^CError in atexit._run_exitfuncs:
Traceback (most recent call last):
File "/lib/python3.8/site-packages/multiprocess/util.py", line 277, in _run_finalizers
finalizer()
File "/lib/python3.8/site-packages/multiprocess/util.py", line 201, in __call__
res = self._callback(*self._args, **self._kwargs)
File "/lib/python3.8/site-packages/multiprocess/pool.py", line 689, in _terminate_pool
cls._help_stuff_finish(inqueue, task_handler, len(pool))
File "/lib/python3.8/site-packages/multiprocess/pool.py", line 674, in _help_stuff_finish
inqueue._rlock.acquire()
KeyboardInterrupt
Similar problem occured when I had some faulty code and it raised exception in one of the subprocesses - the whole program didn't terminate, and hanged until given a KeyboardInterrupt.
OS: macOS 10.14.6
Activity
[-]Hangs after tests complete[/-][+]Hangs after pytest tests complete[/+]mmckerns commentedon Jun 12, 2021
I think
pytestdoesn't play well withmutiprocessing(and hencepathos). Specifically I've been rolling my own tests intest.__main__and not usingpytestsince reading thepytestdocs a way back, and seeing notes about issues withmultiprocessing.I am on the fence about putting
pytestsupport in "won't-fix", so I'll leave this open for now.