From e0b1c23145f6529d39cfa5424403c77f21d0839f Mon Sep 17 00:00:00 2001 From: Antoine Pitrou Date: Tue, 18 Dec 2012 23:03:42 +0100 Subject: Try to make test_threaded_import faster and safer (issue #15599). --- Lib/test/test_threaded_import.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Lib/test/test_threaded_import.py b/Lib/test/test_threaded_import.py index 93bfb2a..e0c23de 100644 --- a/Lib/test/test_threaded_import.py +++ b/Lib/test/test_threaded_import.py @@ -72,7 +72,7 @@ class Finder: with self.lock: self.numcalls += 1 x = self.x - time.sleep(0.1) + time.sleep(0.01) self.x = x + 1 class FlushingFinder: @@ -117,7 +117,7 @@ class ThreadedImportTests(unittest.TestCase): t = threading.Thread(target=task, args=(N, done, done_tasks, errors,)) t.start() - done.wait(60) + self.assertTrue(done.wait(60)) self.assertFalse(errors) if verbose: print("OK.") -- cgit v0.12