summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_asyncio/utils.py
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2023-09-29 11:49:30 (GMT)
committerGitHub <noreply@github.com>2023-09-29 11:49:30 (GMT)
commitdb0a258e796703e12befea9d6dec04e349ca2f5b (patch)
tree2f64962f2798a8b06bb22a38ce56eab7fc8683eb /Lib/test/test_asyncio/utils.py
parente27adc68ccee8345e05b7516e6b46f6c7ff53371 (diff)
downloadcpython-db0a258e796703e12befea9d6dec04e349ca2f5b.zip
cpython-db0a258e796703e12befea9d6dec04e349ca2f5b.tar.gz
cpython-db0a258e796703e12befea9d6dec04e349ca2f5b.tar.bz2
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.
Diffstat (limited to 'Lib/test/test_asyncio/utils.py')
-rw-r--r--Lib/test/test_asyncio/utils.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_asyncio/utils.py b/Lib/test/test_asyncio/utils.py
index 1e5ab6e..e1101bf 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):