aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/test/_test_multiprocessing.py
diff options
context:
space:
mode:
authorKoki Saito <49419225+saito828koki@users.noreply.github.com>2022-10-03 09:41:01 +0900
committerGitHub <noreply@github.com>2022-10-02 17:41:01 -0700
commit19ca114645bd8796cf4094e152b1fa9944da473d (patch)
treeb29d4dbc8ece5be4a1e2380fda58e2372bd63259 /Lib/test/_test_multiprocessing.py
parent14d4f68ebb495fe7ccbaf283386d861a054d8288 (diff)
downloadcpython-19ca114645bd8796cf4094e152b1fa9944da473d.tar.gz
cpython-19ca114645bd8796cf4094e152b1fa9944da473d.zip
gh-96819: multiprocessing.resource_tracker: check if length of pipe write <= 512 (#96890)
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
Diffstat (limited to 'Lib/test/_test_multiprocessing.py')
-rw-r--r--Lib/test/_test_multiprocessing.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/_test_multiprocessing.py b/Lib/test/_test_multiprocessing.py
index a35e527eea4..f74d8d7fbd7 100644
--- a/Lib/test/_test_multiprocessing.py
+++ b/Lib/test/_test_multiprocessing.py
@@ -5432,6 +5432,14 @@ class TestResourceTracker(unittest.TestCase):
self.assertTrue(is_resource_tracker_reused)
+ def test_too_long_name_resource(self):
+ # gh-96819: Resource names that will make the length of a write to a pipe
+ # greater than PIPE_BUF are not allowed
+ rtype = "shared_memory"
+ too_long_name_resource = "a" * (512 - len(rtype))
+ with self.assertRaises(ValueError):
+ resource_tracker.register(too_long_name_resource, rtype)
+
class TestSimpleQueue(unittest.TestCase):