Skip to content
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
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
Copy Markdown
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
Copy Markdown
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