Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions Lib/test/test_concurrent_futures/test_wait.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,9 @@ def test_all_completed(self):

def test_timeout(self):
short_timeout = 0.050
long_timeout = short_timeout * 10
event = threading.Event()

future = self.executor.submit(time.sleep, long_timeout)
future = self.executor.submit(event.wait)

finished, pending = futures.wait(
[CANCELLED_AND_NOTIFIED_FUTURE,
Expand All @@ -126,6 +126,9 @@ def test_timeout(self):
timeout=short_timeout,
return_when=futures.ALL_COMPLETED)

event.set()
futures.wait([future], return_when=futures.ALL_COMPLETED)

self.assertEqual(set([CANCELLED_AND_NOTIFIED_FUTURE,
EXCEPTION_FUTURE,
SUCCESSFUL_FUTURE]),
Expand Down
Loading