From ba7d754e5f7d6e6be237fb8ba511783e17fc48f9 Mon Sep 17 00:00:00 2001 From: Hai Shi Date: Mon, 4 May 2020 23:05:54 +0800 Subject: [PATCH] bpo-40135: Fix multiprocessing test_shared_memory_across_processes() (GH-19892) Don't define shared memory block's name in test_shared_memory_across_processes(): use SharedMemory(create=True) instead. (cherry picked from commit caa3ef284a2e5e5b9bdd6a9e619804122c842d80) Co-authored-by: Hai Shi --- Lib/test/_test_multiprocessing.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Lib/test/_test_multiprocessing.py b/Lib/test/_test_multiprocessing.py index 5943dd83cc143e..ff58481f00314d 100644 --- a/Lib/test/_test_multiprocessing.py +++ b/Lib/test/_test_multiprocessing.py @@ -3828,7 +3828,9 @@ class OptionalAttachSharedMemory(shared_memory.SharedMemory): 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.