From 1e1f04466c07d5aa621724b1a2e7575c36ab3953 Mon Sep 17 00:00:00 2001 From: rahulsmahadev Date: Thu, 3 Dec 2026 17:22:47 +0000 Subject: [PATCH] Make the content cache expiry test pass on Windows with Python 3.12 time.monotonic() advances in 15.6 ms steps on Windows before Python 3.13, and the TTLCache from #4527 reads it, so a 10 ms sleep often leaves the 1 ms entry unexpired and the windows-unit-test (3.12) job fails. Sleep 50 ms instead. Co-authored-by: Isaac --- tests/io/test_content_cache.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/io/test_content_cache.py b/tests/io/test_content_cache.py index 816fd23358..e57dc4e640 100644 --- a/tests/io/test_content_cache.py +++ b/tests/io/test_content_cache.py @@ -72,7 +72,8 @@ def test_cache_expires_entries(metadata_file: str) -> None: with patch.object(io, "new_input", side_effect=io.new_input) as new_input: _open_metadata_file(io, metadata_file) - time.sleep(0.01) + # Longer than the 15.6 ms steps of time.monotonic() on Windows before Python 3.13 + time.sleep(0.05) _open_metadata_file(io, metadata_file) assert new_input.call_count == 2