Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh-109565: Fix concurrent.futures test_future_times_out() #109949

Merged
merged 1 commit into from
Sep 27, 2023
Merged
Changes from all commits
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_as_completed.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,14 @@ def test_future_times_out(self):
EXCEPTION_FUTURE,
SUCCESSFUL_FUTURE}

for timeout in (0, 0.01):
# Windows clock resolution is around 15.6 ms
short_timeout = 0.100
for timeout in (0, short_timeout):
with self.subTest(timeout):

future = self.executor.submit(time.sleep, 0.1)
completed_futures = set()
future = self.executor.submit(time.sleep, short_timeout * 10)

try:
for f in futures.as_completed(
already_completed | {future},
Expand Down
Loading