From 96a6cbc5b0aee267f47e5efb50fba183b52cd8c6 Mon Sep 17 00:00:00 2001 From: Xavier de Gaye Date: Sat, 25 Nov 2017 11:53:07 +0100 Subject: [PATCH 1/2] bpo-32126: Skip asyncio test when sem_open() is not functional --- Lib/test/test_asyncio/test_events.py | 2 ++ Misc/NEWS.d/next/Tests/2017-11-24-18-15-12.bpo-32126.PLmNLn.rst | 2 ++ 2 files changed, 4 insertions(+) create mode 100644 Misc/NEWS.d/next/Tests/2017-11-24-18-15-12.bpo-32126.PLmNLn.rst diff --git a/Lib/test/test_asyncio/test_events.py b/Lib/test/test_asyncio/test_events.py index 78b30b9b6c3224..cac14ae9a0dab0 100644 --- a/Lib/test/test_asyncio/test_events.py +++ b/Lib/test/test_asyncio/test_events.py @@ -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') async def main(): pool = concurrent.futures.ProcessPoolExecutor() result = await self.loop.run_in_executor( diff --git a/Misc/NEWS.d/next/Tests/2017-11-24-18-15-12.bpo-32126.PLmNLn.rst b/Misc/NEWS.d/next/Tests/2017-11-24-18-15-12.bpo-32126.PLmNLn.rst new file mode 100644 index 00000000000000..b5ba9d574e35b4 --- /dev/null +++ b/Misc/NEWS.d/next/Tests/2017-11-24-18-15-12.bpo-32126.PLmNLn.rst @@ -0,0 +1,2 @@ +Skip test_get_event_loop_new_process in test.test_asyncio.test_events when +sem_open() is not functional. From 2d505739768ff946b01a7d20ff67e4c9becfffda Mon Sep 17 00:00:00 2001 From: Xavier de Gaye Date: Sun, 26 Nov 2017 09:58:28 +0100 Subject: [PATCH 2/2] Update the comment --- Lib/test/test_asyncio/test_events.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Lib/test/test_asyncio/test_events.py b/Lib/test/test_asyncio/test_events.py index cac14ae9a0dab0..d60262cca2e7f1 100644 --- a/Lib/test/test_asyncio/test_events.py +++ b/Lib/test/test_asyncio/test_events.py @@ -2156,7 +2156,9 @@ def tearDown(self): super().tearDown() def test_get_event_loop_new_process(self): - # Skip the test if the sem_open() implementation is broken. + # Issue bpo-32126: The multiprocessing module used by + # ProcessPoolExecutor is not functional when the + # multiprocessing.synchronize module cannot be imported. support.import_module('multiprocessing.synchronize') async def main(): pool = concurrent.futures.ProcessPoolExecutor()