[Python-checkins] gh-95212: make multiprocessing test case parallel-safe (GH-95213)
miss-islington
webhook-mailer at python.org
Mon Jul 25 01:11:34 EDT 2022
https://github.com/python/cpython/commit/49d038496e851f6571a267cfd387dd7094bdd832
commit: 49d038496e851f6571a267cfd387dd7094bdd832
branch: 3.11
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: miss-islington <31488909+miss-islington at users.noreply.github.com>
date: 2022-07-24T22:11:30-07:00
summary:
gh-95212: make multiprocessing test case parallel-safe (GH-95213)
(cherry picked from commit 5956de16cd00e7e1cf5cbf3d7b4a930eaa928321)
Co-authored-by: Christian Heimes <christian at python.org>
files:
A Misc/NEWS.d/next/Tests/2022-07-24-20-19-05.gh-issue-95212.fHiU4e.rst
M Lib/test/_test_multiprocessing.py
diff --git a/Lib/test/_test_multiprocessing.py b/Lib/test/_test_multiprocessing.py
index 4f0df0f508f73..599c3f2abf33c 100644
--- a/Lib/test/_test_multiprocessing.py
+++ b/Lib/test/_test_multiprocessing.py
@@ -3971,7 +3971,7 @@ def test_shared_memory_recreate(self):
'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
index 0000000000000..44cea181cc1f1
--- /dev/null
+++ b/Misc/NEWS.d/next/Tests/2022-07-24-20-19-05.gh-issue-95212.fHiU4e.rst
@@ -0,0 +1,2 @@
+Make multiprocessing test case ``test_shared_memory_recreate``
+parallel-safe.
More information about the Python-checkins
mailing list