[3.12] gh-110088, gh-109878: Fix test_asyncio timeouts (#110092) (#110098)

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.

(cherry picked from commit db0a258e79)
This commit is contained in:
Victor Stinner 2023-10-02 21:35:29 +02:00 committed by GitHub
parent c188a13c8e
commit 0745ab88e5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 19 additions and 54 deletions

View file

@ -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):
if hasattr(support, 'TEST_HOME_DIR'):
fullname = os.path.join(support.TEST_HOME_DIR, filename)