Skip to content

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

Merged
vstinner merged 3 commits into
python:mainfrom
mhsmith:timerfd-10ms
Mar 27, 2024
Merged

vstinner merged 3 commits into
python:mainfrom
mhsmith:timerfd-10ms

Conversation

@mhsmith

@mhsmith mhsmith commented Mar 25, 2024 •

Copy link
Copy Markdown
Member

These tests currently have a tolerance of 1 ms, but when testing on an Android emulator on a relatively slow laptop, I find they sometimes fail because they experienced a delay of 2 ms.

As @vstinner said at #108277 (comment):

I don't think that Python should test the operating system itself, it should just test that it's thin wrapper to OS functions "seem to work".

So increasing the tolerance to 10 ms seems reasonable.

This PR also fixes a mistake in the tests, where CLOCK_RES was calculated using a multiplication rather than a division, causing all of its assertions to succeed trivially.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip news tests Tests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants