[Python-checkins] bpo-26762: _test_multiprocessing reports dangling (#3064)

Victor Stinner webhook-mailer at python.org
Thu Aug 10 11:36:54 EDT 2017


https://github.com/python/cpython/commit/957d0e9b59bd27ca7c473560634d8b5dbe66338c
commit: 957d0e9b59bd27ca7c473560634d8b5dbe66338c
branch: master
author: Victor Stinner <victor.stinner at gmail.com>
committer: GitHub <noreply at github.com>
date: 2017-08-10T17:36:50+02:00
summary:

bpo-26762: _test_multiprocessing reports dangling (#3064)

_test_multiprocessing now marks the test as ENV_CHANGED on dangling
process or thread.

files:
M Lib/test/_test_multiprocessing.py

diff --git a/Lib/test/_test_multiprocessing.py b/Lib/test/_test_multiprocessing.py
index e18f7cd3d1d..cce3c0287e9 100644
--- a/Lib/test/_test_multiprocessing.py
+++ b/Lib/test/_test_multiprocessing.py
@@ -4329,12 +4329,14 @@ def tearDownClass(cls):
 
         processes = set(multiprocessing.process._dangling) - set(cls.dangling[0])
         if processes:
+            test.support.environment_altered = True
             print('Warning -- Dangling processes: %s' % processes,
                   file=sys.stderr)
         processes = None
 
         threads = set(threading._dangling) - set(cls.dangling[1])
         if threads:
+            test.support.environment_altered = True
             print('Warning -- Dangling threads: %s' % threads,
                   file=sys.stderr)
         threads = None
@@ -4402,6 +4404,7 @@ def tearDownClass(cls):
             t *= 2
             dt = time.monotonic() - start_time
             if dt >= 5.0:
+                test.support.environment_altered = True
                 print("Warning -- multiprocessing.Manager still has %s active "
                       "children after %s seconds"
                       % (multiprocessing.active_children(), dt),
@@ -4413,6 +4416,7 @@ def tearDownClass(cls):
             # This is not really an error since some tests do not
             # ensure that all processes which hold a reference to a
             # managed object have been joined.
+            test.support.environment_altered = True
             print('Warning -- Shared objects which still exist at manager '
                   'shutdown:')
             print(cls.manager._debug_info())
@@ -4511,6 +4515,7 @@ def tearDownModule():
         processes = set(multiprocessing.process._dangling) - set(dangling[0])
         if processes:
             need_sleep = True
+            test.support.environment_altered = True
             print('Warning -- Dangling processes: %s' % processes,
                   file=sys.stderr)
         processes = None
@@ -4518,6 +4523,7 @@ def tearDownModule():
         threads = set(threading._dangling) - set(dangling[1])
         if threads:
             need_sleep = True
+            test.support.environment_altered = True
             print('Warning -- Dangling threads: %s' % threads,
                   file=sys.stderr)
         threads = None



More information about the Python-checkins mailing list