summaryrefslogtreecommitdiffstats
path: root/Lib/test/_test_multiprocessing.py
diff options
context:
space:
mode:
authorNikita Sobolev <mail@sobolevn.me>2021-09-21 17:49:42 (GMT)
committerGitHub <noreply@github.com>2021-09-21 17:49:42 (GMT)
commitf604cf1c377a7648e0686044e6e49900bfc9feef (patch)
tree3cfed33b93dd811ec0eba6cdecfba6d5dcb6bdf7 /Lib/test/_test_multiprocessing.py
parent1c7e98dc258a0e7ccd2325a1aefc4aa2de51e1c5 (diff)
downloadcpython-f604cf1c377a7648e0686044e6e49900bfc9feef.zip
cpython-f604cf1c377a7648e0686044e6e49900bfc9feef.tar.gz
cpython-f604cf1c377a7648e0686044e6e49900bfc9feef.tar.bz2
bpo-45209: fix `UserWarning: resource_tracker` in test_multiprocessing (GH-28377)
Diffstat (limited to 'Lib/test/_test_multiprocessing.py')
-rw-r--r--Lib/test/_test_multiprocessing.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/test/_test_multiprocessing.py b/Lib/test/_test_multiprocessing.py
index 8ebcd0d..125e890 100644
--- a/Lib/test/_test_multiprocessing.py
+++ b/Lib/test/_test_multiprocessing.py
@@ -4178,6 +4178,13 @@ class _TestSharedMemory(BaseTestCase):
" a process was abruptly terminated.")
if os.name == 'posix':
+ # Without this line it was raising warnings like:
+ # UserWarning: resource_tracker:
+ # There appear to be 1 leaked shared_memory
+ # objects to clean up at shutdown
+ # See: https://bugs.python.org/issue45209
+ resource_tracker.unregister(f"/{name}", "shared_memory")
+
# A warning was emitted by the subprocess' own
# resource_tracker (on Windows, shared memory segments
# are released automatically by the OS).