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
b1aebf1e6576680d606068d17e2208259573e061)
Co-authored-by: Victor Stinner <vstinner@python.org>
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},