Made test_idle_thread_reuse more reliable (#92)
Depending on machine load or other unknown influences
on the Linux scheduler, this would often fail with
File "test_futures.py", line 558, in test_idle_thread_reuse
self.assertEqual(len(executor._threads), 1)
AssertionError: 2 != 1
diff --git a/test_futures.py b/test_futures.py
index c2ae2d0..5ee4e71 100644
--- a/test_futures.py
+++ b/test_futures.py
@@ -577,7 +577,9 @@
def test_idle_thread_reuse(self):
executor = self.executor_type()
executor.submit(mul, 21, 2).result()
+ time.sleep(0.001)
executor.submit(mul, 6, 7).result()
+ time.sleep(0.001)
executor.submit(mul, 3, 14).result()
self.assertEqual(len(executor._threads), 1)
executor.shutdown(wait=True)