Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hangs after pytest tests complete #67

Open
ikamensh opened this issue Feb 14, 2020 · 1 comment
Open

Hangs after pytest tests complete #67

ikamensh opened this issue Feb 14, 2020 · 1 comment

Comments

@ikamensh
Copy link

ikamensh commented Feb 14, 2020

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

@ikamensh ikamensh changed the title Hangs after tests complete Hangs after pytest tests complete Feb 14, 2020
@mmckerns
Copy link
Member

I think pytest doesn't play well with mutiprocessing (and hence pathos). Specifically I've been rolling my own tests in test.__main__ and not using pytest since reading the pytest docs a way back, and seeing notes about issues with multiprocessing.

I am on the fence about putting pytest support in "won't-fix", so I'll leave this open for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants