[py] Use monotonic clock for waits, fixes #10544#10550
Merged
diemol merged 2 commits intoSeleniumHQ:trunkfrom Apr 21, 2022
Merged
[py] Use monotonic clock for waits, fixes #10544#10550diemol merged 2 commits intoSeleniumHQ:trunkfrom
diemol merged 2 commits intoSeleniumHQ:trunkfrom
Conversation
Contributor
Author
symonk
approved these changes
Apr 15, 2022
Codecov Report
@@ Coverage Diff @@
## trunk #10550 +/- ##
=======================================
Coverage 45.02% 45.02%
=======================================
Files 85 85
Lines 5508 5508
Branches 268 268
=======================================
Hits 2480 2480
Misses 2760 2760
Partials 268 268
Continue to review full report at Codecov.
|
elgatov
pushed a commit
to elgatov/selenium
that referenced
this pull request
Jun 27, 2022
…Q#10550) Co-authored-by: Diego Molina <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Thanks for contributing to Selenium!
A PR well described will help maintainers to quickly review and merge it
Before submitting your PR, please check our contributing guidelines.
Avoid large PRs, help reviewers by making them as simple and short as possible.
Description
Use monotonic clock for waits, fixes #10544
Motivation and Context
WebDriverWait uses
time.time(), which displays system clock time and is non-monotonic:selenium/py/selenium/webdriver/support/wait.py
Line 75 in 2a43011
It should instead use
time.monotonic(), which is "not affected by system clock updates"https://docs.python.org/3.7/library/time.html#time.monotonic
https://www.webucator.com/article/python-clocks-explained/
https://en.wikipedia.org/wiki/Monotonic_function
Types of changes
Checklist