]> granicus.if.org Git - python/commitdiff
bpo-33716, test_concurrent_futures: increase timeout (GH-7828) (GH-8264)
authorVictor Stinner <vstinner@redhat.com>
Thu, 12 Jul 2018 09:11:29 +0000 (11:11 +0200)
committerGitHub <noreply@github.com>
Thu, 12 Jul 2018 09:11:29 +0000 (11:11 +0200)
Increase the timeout from 1 min to 5 min.

Replace also time.time() with time.monotonic() for timeouts.

(cherry picked from commit 3ad8decd76c736f393755537aeb19b5612c21761)

Lib/test/test_concurrent_futures.py

index 5ddce09a08bc47569eec9dc961c9662eb81d35d1..1ce0c15512bf19097074897a07d6db2f2082db85 100644 (file)
@@ -79,7 +79,7 @@ class ExecutorMixin:
     def setUp(self):
         super().setUp()
 
-        self.t1 = time.time()
+        self.t1 = time.monotonic()
         try:
             self.executor = self.executor_type(max_workers=self.worker_count)
         except NotImplementedError as e:
@@ -90,10 +90,10 @@ class ExecutorMixin:
         self.executor.shutdown(wait=True)
         self.executor = None
 
-        dt = time.time() - self.t1
+        dt = time.monotonic() - self.t1
         if test.support.verbose:
             print("%.2fs" % dt, end=' ')
-        self.assertLess(dt, 60, "synchronization issue: test lasted too long")
+        self.assertLess(dt, 300, "synchronization issue: test lasted too long")
 
         super().tearDown()