Skip to content

Commit f604cf1

Browse files
authored
bpo-45209: fix UserWarning: resource_tracker in test_multiprocessing (GH-28377)
1 parent 1c7e98d commit f604cf1

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

Lib/test/_test_multiprocessing.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4178,6 +4178,13 @@ def test_shared_memory_cleaned_after_process_termination(self):
41784178
" a process was abruptly terminated.")
41794179

41804180
if os.name == 'posix':
4181+
# Without this line it was raising warnings like:
4182+
# UserWarning: resource_tracker:
4183+
# There appear to be 1 leaked shared_memory
4184+
# objects to clean up at shutdown
4185+
# See: https://bugs.python.org/issue45209
4186+
resource_tracker.unregister(f"/{name}", "shared_memory")
4187+
41814188
# A warning was emitted by the subprocess' own
41824189
# resource_tracker (on Windows, shared memory segments
41834190
# are released automatically by the OS).
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Fix ``UserWarning: resource_tracker`` warning in
2+
``_test_multiprocessing._TestSharedMemory.test_shared_memory_cleaned_after_process_termination``

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy