]> granicus.if.org Git - python/commitdiff
bpo-31249: Fix test_concurrent_futures dangling thread (#3521)
authorVictor Stinner <victor.stinner@gmail.com>
Wed, 13 Sep 2017 00:05:53 +0000 (17:05 -0700)
committerGitHub <noreply@github.com>
Wed, 13 Sep 2017 00:05:53 +0000 (17:05 -0700)
ProcessPoolShutdownTest.test_del_shutdown() now closes the call queue
and joins its thread, to prevent leaking a dangling thread.

Lib/test/test_concurrent_futures.py

index a888dcacc49160b339e7f6163ff1da810e21a6b5..7bc733efb1eeb91dad075e6efd17269eee5d9c97 100644 (file)
@@ -222,11 +222,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: