summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_concurrent_futures.py
diff options
context:
space:
mode:
authorPablo Galindo <Pablogsal@gmail.com>2018-06-21 11:30:37 (GMT)
committerGitHub <noreply@github.com>2018-06-21 11:30:37 (GMT)
commit3ad8decd76c736f393755537aeb19b5612c21761 (patch)
tree34354d374a4149a73f7f37b36fc49af21ae438dc /Lib/test/test_concurrent_futures.py
parent940ae608566fd4446ff92a22705f646cde1d087c (diff)
downloadcpython-3ad8decd76c736f393755537aeb19b5612c21761.zip
cpython-3ad8decd76c736f393755537aeb19b5612c21761.tar.gz
cpython-3ad8decd76c736f393755537aeb19b5612c21761.tar.bz2
bpo-33716, test_concurrent_futures: increase timeout (GH-7828)
Increase the timeout from 1 min to 5 min. Replace also time.time() with time.monotonic() for timeouts.
Diffstat (limited to 'Lib/test/test_concurrent_futures.py')
-rw-r--r--Lib/test/test_concurrent_futures.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/Lib/test/test_concurrent_futures.py b/Lib/test/test_concurrent_futures.py
index f2c28ac..01125c7 100644
--- a/Lib/test/test_concurrent_futures.py
+++ b/Lib/test/test_concurrent_futures.py
@@ -109,7 +109,7 @@ class ExecutorMixin:
def setUp(self):
super().setUp()
- self.t1 = time.time()
+ self.t1 = time.monotonic()
if hasattr(self, "ctx"):
self.executor = self.executor_type(
max_workers=self.worker_count,
@@ -125,10 +125,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()
@@ -240,9 +240,9 @@ class FailingInitializerMixin(ExecutorMixin):
with self.assertRaises(BrokenExecutor):
future.result()
# At some point, the executor should break
- t1 = time.time()
+ t1 = time.monotonic()
while not self.executor._broken:
- if time.time() - t1 > 5:
+ if time.monotonic() - t1 > 5:
self.fail("executor not broken after 5 s.")
time.sleep(0.01)
# ... and from this point submit() is guaranteed to fail