]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.14] gh-126112: Fix test_os.TimerfdTests: use 10 ms resolution (GH-135681) (#135704)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Thu, 19 Jun 2025 10:06:57 +0000 (12:06 +0200)
committerGitHub <noreply@github.com>
Thu, 19 Jun 2025 10:06:57 +0000 (10:06 +0000)
gh-126112: Fix test_os.TimerfdTests: use 10 ms resolution (GH-135681)

Use 10 ms for CLOCK_RES instead of 100 ms to tolerate slow buildbots.
(cherry picked from commit 5c25c884b93eb79f640c47d6dba20f11fdf0ade4)

Co-authored-by: Victor Stinner <vstinner@python.org>
Lib/test/test_os.py

index 88b5b0e6e358bb0c7d632bfbd0eed4431293ac14..8f56b4559f46c6d93983d00d2abd9b484220d0d9 100644 (file)
@@ -13,7 +13,6 @@ import itertools
 import locale
 import os
 import pickle
-import platform
 import select
 import selectors
 import shutil
@@ -4291,13 +4290,8 @@ class EventfdTests(unittest.TestCase):
 @unittest.skipIf(sys.platform == "android", "gh-124873: Test is flaky on Android")
 @support.requires_linux_version(2, 6, 30)
 class TimerfdTests(unittest.TestCase):
-    # 1 ms accuracy is reliably achievable on every platform except Android
-    # emulators, where we allow 10 ms (gh-108277).
-    if sys.platform == "android" and platform.android_ver().is_emulator:
-        CLOCK_RES_PLACES = 2
-    else:
-        CLOCK_RES_PLACES = 3
-
+    # gh-126112: Use 10 ms to tolerate slow buildbots
+    CLOCK_RES_PLACES = 2  # 10 ms
     CLOCK_RES = 10 ** -CLOCK_RES_PLACES
     CLOCK_RES_NS = 10 ** (9 - CLOCK_RES_PLACES)