]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-40135: Fix multiprocessing test_shared_memory_across_processes() (GH-19892)
authorHai Shi <shihai1992@gmail.com>
Mon, 4 May 2020 15:05:54 +0000 (23:05 +0800)
committerGitHub <noreply@github.com>
Mon, 4 May 2020 15:05:54 +0000 (17:05 +0200)
Don't define shared memory block's name in test_shared_memory_across_processes():
use SharedMemory(create=True) instead.

Lib/test/_test_multiprocessing.py

index dd894f21f7afcd947f16787e0c0ad4909b6b1359..dc8164f3288e1b379a879931d2f340335fa5521b 100644 (file)
@@ -3860,7 +3860,9 @@ class _TestSharedMemory(BaseTestCase):
         sms.close()
 
     def test_shared_memory_across_processes(self):
-        sms = shared_memory.SharedMemory('test02_tsmap', True, size=512)
+        # bpo-40135: don't define shared memory block's name in case of
+        # the failure when we run multiprocessing tests in parallel.
+        sms = shared_memory.SharedMemory(create=True, size=512)
         self.addCleanup(sms.unlink)
 
         # Verify remote attachment to existing block by name is working.