8000 gh-108277: Make test_os tolerate 10 ms diff for timerfd on Android emulators by mhsmith · Pull Request #117223 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-108277: Make test_os tolerate 10 ms diff for timerfd on Android emulators #117223

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 27, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
8000 Diff view
Diff view
Prev Previous commit
Next Next commit
Use is_emulator in timerfd tests
  • Loading branch information
mhsmith committed Mar 27, 2024
commit 07ff1215e03181c1aefadfef8de526efc1cdb38d
11 changes: 9 additions & 2 deletions Lib/test/test_os.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import locale
import os
import pickle
import platform
import select
import selectors
import shutil
Expand Down Expand Up @@ -4085,8 +4086,14 @@ def test_eventfd_select(self):
@unittest.skipUnless(hasattr(os, 'timerfd_create'), 'requires os.timerfd_create')
@support.requires_linux_version(2, 6, 30)
class TimerfdTests(unittest.TestCase):
# Tolerate a difference of 10 ms
CLOCK_RES_PLACES = 2
if sys.platform == "android" and platform.android_ver().is_emulator:
# Tolerate a difference of 10 ms (1 ms is not reliably achievable on
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you mention Android emulator explicitly? Usually, we also mention the issue number: gh-108277.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've updated the comment.

# slower machines).
CLOCK_RES_PLACES = 2
else:
# Tolerate a difference of 1 ms
CLOCK_RES_PLACES = 3

CLOCK_RES = 10 ** -CLOCK_RES_PLACES
CLOCK_RES_NS = 10 ** (9 - CLOCK_RES_PLACES)

Expand Down
0