From db0a258e796703e12befea9d6dec04e349ca2f5b Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Fri, 29 Sep 2023 13:49:30 +0200 Subject: gh-110088, gh-109878: Fix test_asyncio timeouts (#110092) Fix test_asyncio timeouts: don't measure the maximum duration, a test should not measure a CI performance. Only measure the minimum duration when a task has a timeout or delay. Add CLOCK_RES to test_asyncio.utils. --- Lib/test/test_asyncio/utils.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'Lib/test/test_asyncio/utils.py') diff --git a/Lib/test/test_asyncio/utils.py b/Lib/test/test_asyncio/utils.py index 1e5ab6eb935..e1101bf42eb 100644 --- a/Lib/test/test_asyncio/utils.py +++ b/Lib/test/test_asyncio/utils.py @@ -36,6 +36,12 @@ from test.support import socket_helper from test.support import threading_helper +# Use the maximum known clock resolution (gh-75191, gh-110088): Windows +# GetTickCount64() has a resolution of 15.6 ms. Use 20 ms to tolerate rounding +# issues. +CLOCK_RES = 0.020 + + def data_file(*filename): fullname = os.path.join(support.TEST_HOME_DIR, *filename) if os.path.isfile(fullname): -- cgit v1.2.3