Skip to content

bpo-32126: Skip asyncio test when sem_open() is not functional #4559

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

Merged
merged 2 commits into from
Nov 26, 2017
Merged

bpo-32126: Skip asyncio test when sem_open() is not functional #4559

merged 2 commits into from
Nov 26, 2017

Conversation

xdegaye
Copy link
Contributor

@xdegaye xdegaye commented Nov 25, 2017

@@ -2156,6 +2156,8 @@ def tearDown(self):
super().tearDown()

def test_get_event_loop_new_process(self):
# Skip the test if the sem_open() implementation is broken.
support.import_module('multiprocessing.synchronize')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The check is very non-obvious.
Don't how to make it more verbose and explicit.
If it's impossible -- I can live with it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ProcessPoolExecutor uses the multiprocessing (mp) module. The mp module is not functional when the mp.synchronize module cannot be imported and all the mp tests are skipped in that case. So we use here the same idiom used to skip the mp tests (i.e. test.support.import_module('multiprocessing.synchronize')) to skip this test when the platform sem_open implementation is broken or missing.

What about replacing the comment with:

Issue bpo-32126: The multiprocessing module used by ProcessPoolExecutor
is not functional when the multiprocessing.synchronize module cannot be imported.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New comment text is perfect!

@xdegaye xdegaye merged commit a6fba9b into python:master Nov 26, 2017
@xdegaye xdegaye deleted the bpo-32126 branch November 26, 2017 09:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests Tests in the Lib/test dir topic-asyncio
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants