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.
This commit is contained in:
Hai Shi 2020-05-04 23:05:54 +08:00 committed by GitHub
parent b88cd585d3
commit caa3ef284a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View 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.