]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-95212: make multiprocessing test case parallel-safe (GH-95213)
authorChristian Heimes <christian@python.org>
Mon, 25 Jul 2022 04:44:40 +0000 (06:44 +0200)
committerGitHub <noreply@github.com>
Mon, 25 Jul 2022 04:44:40 +0000 (06:44 +0200)
Lib/test/_test_multiprocessing.py
Misc/NEWS.d/next/Tests/2022-07-24-20-19-05.gh-issue-95212.fHiU4e.rst [new file with mode: 0644]

index e3e7ee39ebdb86dcd2d77728ded11ff81e5fbfa4..b78586c560a68a5dff4d2d3392a292f8ecea5185 100644 (file)
@@ -3973,7 +3973,7 @@ class _TestSharedMemory(BaseTestCase):
             'multiprocessing.shared_memory._make_filename') as mock_make_filename:
 
             NAME_PREFIX = shared_memory._SHM_NAME_PREFIX
-            names = ['test01_fn', 'test02_fn']
+            names = [self._new_shm_name('test03_fn'), self._new_shm_name('test04_fn')]
             # Prepend NAME_PREFIX which can be '/psm_' or 'wnsm_', necessary
             # because some POSIX compliant systems require name to start with /
             names = [NAME_PREFIX + name for name in names]
diff --git a/Misc/NEWS.d/next/Tests/2022-07-24-20-19-05.gh-issue-95212.fHiU4e.rst b/Misc/NEWS.d/next/Tests/2022-07-24-20-19-05.gh-issue-95212.fHiU4e.rst
new file mode 100644 (file)
index 0000000..44cea18
--- /dev/null
@@ -0,0 +1,2 @@
+Make multiprocessing test case ``test_shared_memory_recreate``
+parallel-safe.