-
-
Notifications
You must be signed in to change notification settings - Fork 31.6k
instanciation of multiprocessing.Queue raises ImportError in test_logging #72854
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
Comments
Occurs on Android that has a broken shared semaphore implementation (bpo-26924). One of the backtraces: ====================================================================== Traceback (most recent call last):
File "/sdcard/org.bitbucket.pyona/lib/python3.7/multiprocessing/synchronize.py", line 29, in <modu
le>
from _multiprocessing import SemLock, sem_unlink
ImportError: cannot import name 'sem_unlink'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/sdcard/org.bitbucket.pyona/lib/python3.7/unittest/mock.py", line 1179, in patched
return func(*args, **keywargs)
File "/sdcard/org.bitbucket.pyona/lib/python3.7/test/test_logging.py", line 3130, in test_handle_c
alled_with_mp_queue
log_queue = multiprocessing.Queue()
File "/sdcard/org.bitbucket.pyona/lib/python3.7/multiprocessing/context.py", line 102, in Queue
return Queue(maxsize, ctx=self.get_context())
File "/sdcard/org.bitbucket.pyona/lib/python3.7/multiprocessing/queues.py", line 39, in __init__
from .synchronize import SEM_VALUE_MAX as maxsize
File "/sdcard/org.bitbucket.pyona/lib/python3.7/multiprocessing/synchronize.py", line 34, in <modu
le>
" function, see issue 3770.")
ImportError: This platform lacks a functioning sem_open implementation, therefore, the required sync
hronization primitives needed will not function, see issue 3770. |
The decorator doesn't need arguments. I would make it similar to skip_unless_symlink. |
When the test is to be skipped:
|
requires_multiprocessing_queue is used only in test_logging. Is it worth to add it in test.support? |
IMHO other tests in the future may instantiate multiprocessing.Queue() and come up with another new decorator when the test fails on the (yet to come) Android buildbot, ignoring that one already exists if we move the decorator to the test_logging module. |
Okay. test_multiprocessing_queue_2.patch LGTM. |
New changeset a377e6987821 by Xavier de Gaye in branch '3.5': New changeset e5404ba1b19e by Xavier de Gaye in branch '3.6': New changeset 1f0b0ecf7dc1 by Xavier de Gaye in branch 'default': |
The multiprocessing module is not functional when the multiprocessing.synchronize module cannot be imported and all the multiprocessing tests are skipped in that case. Use the same idiom (i.e. test.support.import_module('multiprocessing.synchronize')) to skip the tests when the platform sem_open implementation is broken and remove test.support.requires_multiprocessing_queue. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: