mirror of
https://github.com/python/cpython.git
synced 2026-01-06 07:22:09 +00:00
Revert "gh-128364: Fix flaky test_timeout test (gh-130724)" (gh-130732)
Change broke Android and iOS buildbots that do not have multiprocessing.
This reverts commit cfa0b1dc37.
This commit is contained in:
parent
cfa0b1dc37
commit
5221d9ce0e
2 changed files with 2 additions and 11 deletions
|
|
@ -114,8 +114,9 @@ def test_all_completed(self):
|
|||
|
||||
def test_timeout(self):
|
||||
short_timeout = 0.050
|
||||
long_timeout = short_timeout * 10
|
||||
|
||||
future = self.executor.submit(self.event.wait)
|
||||
future = self.executor.submit(time.sleep, long_timeout)
|
||||
|
||||
finished, pending = futures.wait(
|
||||
[CANCELLED_AND_NOTIFIED_FUTURE,
|
||||
|
|
@ -131,9 +132,6 @@ def test_timeout(self):
|
|||
finished)
|
||||
self.assertEqual(set([future]), pending)
|
||||
|
||||
# Set the event to allow the future to complete
|
||||
self.event.set()
|
||||
|
||||
|
||||
class ThreadPoolWaitTests(ThreadPoolMixin, WaitTests, BaseTestCase):
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
import multiprocessing
|
||||
import sys
|
||||
import threading
|
||||
import time
|
||||
import unittest
|
||||
from concurrent import futures
|
||||
|
|
@ -47,14 +46,11 @@ def setUp(self):
|
|||
|
||||
self.t1 = time.monotonic()
|
||||
if hasattr(self, "ctx"):
|
||||
self.manager = multiprocessing.Manager()
|
||||
self.event = self.manager.Event()
|
||||
self.executor = self.executor_type(
|
||||
max_workers=self.worker_count,
|
||||
mp_context=self.get_context(),
|
||||
**self.executor_kwargs)
|
||||
else:
|
||||
self.event = threading.Event()
|
||||
self.executor = self.executor_type(
|
||||
max_workers=self.worker_count,
|
||||
**self.executor_kwargs)
|
||||
|
|
@ -62,9 +58,6 @@ def setUp(self):
|
|||
def tearDown(self):
|
||||
self.executor.shutdown(wait=True)
|
||||
self.executor = None
|
||||
if hasattr(self, "ctx"):
|
||||
self.manager.shutdown()
|
||||
self.manager = None
|
||||
|
||||
dt = time.monotonic() - self.t1
|
||||
if support.verbose:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue