Skip to content

Commit 73ec1e7

Browse files
[3.12] gh-109565: Fix concurrent.futures test_future_times_out() (GH-109949) (#109952)
gh-109565: Fix concurrent.futures test_future_times_out() (GH-109949) as_completed() uses a timeout of 100 ms instead of 10 ms. Windows monotonic clock resolution is around 15.6 ms. (cherry picked from commit b1aebf1) Co-authored-by: Victor Stinner <vstinner@python.org>
1 parent 1fc25a3 commit 73ec1e7

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Lib/test/test_concurrent_futures/test_as_completed.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,14 @@ def test_future_times_out(self):
4242
EXCEPTION_FUTURE,
4343
SUCCESSFUL_FUTURE}
4444

45-
for timeout in (0, 0.01):
45+
# Windows clock resolution is around 15.6 ms
46+
short_timeout = 0.100
47+
for timeout in (0, short_timeout):
4648
with self.subTest(timeout):
4749

48-
future = self.executor.submit(time.sleep, 0.1)
4950
completed_futures = set()
51+
future = self.executor.submit(time.sleep, short_timeout * 10)
52+
5053
try:
5154
for f in futures.as_completed(
5255
already_completed | {future},

0 commit comments

Comments
 (0)