Skip to content

Commit

Permalink
bpo-33716, test_concurrent_futures: increase timeout (GH-7828)
Browse files Browse the repository at this point in the history
Increase the timeout from 1 min to 5 min.

Replace also time.time() with time.monotonic() for timeouts.
  • Loading branch information
pablogsal committed Jun 21, 2018
1 parent 940ae60 commit 3ad8dec
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Lib/test/test_concurrent_futures.py
Expand Up @@ -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,
Expand All @@ -125,10 +125,10 @@ def tearDown(self):
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()

Expand Down Expand Up @@ -240,9 +240,9 @@ def test_initializer(self):
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
Expand Down

0 comments on commit 3ad8dec

Please sign in to comment.