gh-126112: Fix test_os.TimerfdTests: use 10 ms resolution (#135681)

Use 10 ms for CLOCK_RES instead of 100 ms to tolerate slow buildbots.
This commit is contained in:
Victor Stinner 2025-06-19 11:40:40 +02:00 committed by GitHub
parent 7a20c72cb6
commit 5c25c884b9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

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