Skip to content

[🐛 Bug]: WebDriverWait uses a non-monotonic clock, time.time() #10544

@Kache

Description

@Kache

What happened?

WebDriverWait uses time.time(), which displays system clock time and is non-monotonic:

end_time = time.time() + self._timeout

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

How can we reproduce the issue?

call time.time() around changes to system clock

Relevant log output

n/a

Operating System

n/a

Selenium version

master

What are the browser(s) and version(s) where you see this issue?

n/a

What are the browser driver(s) and version(s) where you see this issue?

n/a

Are you using Selenium Grid?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-pyPython BindingsI-defectSomething is not working as intended

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions