]> granicus.if.org Git - python/commitdiff
[3.6] bpo-31249: Fix test_concurrent_futures dangling thread (GH-3521) (#3522)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Wed, 13 Sep 2017 00:43:44 +0000 (17:43 -0700)
committerVictor Stinner <victor.stinner@gmail.com>
Wed, 13 Sep 2017 00:43:44 +0000 (17:43 -0700)
ProcessPoolShutdownTest.test_del_shutdown() now closes the call queue
and joins its thread, to prevent leaking a dangling thread.
(cherry picked from commit 3bcf157c115ba3e48bce62ac8cb13c703475a113)

Lib/test/test_concurrent_futures.py

index 03f8d1d711227df2cc1dc5f0b722fd9997a38f7a..e5d6b7e09b55007fdb30d650d99bdcad2baa0363 100644 (file)
@@ -226,11 +226,14 @@ class ProcessPoolShutdownTest(ProcessPoolMixin, ExecutorShutdownTest, BaseTestCa
         list(executor.map(abs, range(-5, 5)))
         queue_management_thread = executor._queue_management_thread
         processes = executor._processes
+        call_queue = executor._call_queue
         del executor
 
         queue_management_thread.join()
         for p in processes.values():
             p.join()
+        call_queue.close()
+        call_queue.join_thread()
 
 
 class WaitTests: