diff options
Diffstat (limited to 'Lib/test/test_concurrent_futures.py')
-rw-r--r-- | Lib/test/test_concurrent_futures.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_concurrent_futures.py b/Lib/test/test_concurrent_futures.py index 99651f5..eae98d6 100644 --- a/Lib/test/test_concurrent_futures.py +++ b/Lib/test/test_concurrent_futures.py @@ -463,6 +463,7 @@ class ThreadPoolShutdownTest(ThreadPoolMixin, ExecutorShutdownTest, BaseTestCase executor.map(abs, range(-5, 5)) threads = executor._threads del executor + support.gc_collect() # For PyPy or other GCs. for t in threads: self.assertRegex(t.name, r'^SpecialPool_[0-4]$') @@ -473,6 +474,7 @@ class ThreadPoolShutdownTest(ThreadPoolMixin, ExecutorShutdownTest, BaseTestCase executor.map(abs, range(-5, 5)) threads = executor._threads del executor + support.gc_collect() # For PyPy or other GCs. for t in threads: # Ensure that our default name is reasonably sane and unique when @@ -535,6 +537,7 @@ class ProcessPoolShutdownTest(ExecutorShutdownTest): call_queue = executor._call_queue executor_manager_thread = executor._executor_manager_thread del executor + support.gc_collect() # For PyPy or other GCs. # Make sure that all the executor resources were properly cleaned by # the shutdown process @@ -759,6 +762,7 @@ class AsCompletedTests: futures_list.remove(future) wr = weakref.ref(future) del future + support.gc_collect() # For PyPy or other GCs. self.assertIsNone(wr()) futures_list[0].set_result("test") @@ -766,6 +770,7 @@ class AsCompletedTests: futures_list.remove(future) wr = weakref.ref(future) del future + support.gc_collect() # For PyPy or other GCs. self.assertIsNone(wr()) if futures_list: futures_list[0].set_result("test") @@ -865,6 +870,7 @@ class ExecutorTest: for obj in self.executor.map(make_dummy_object, range(10)): wr = weakref.ref(obj) del obj + support.gc_collect() # For PyPy or other GCs. self.assertIsNone(wr()) |