Skip to content

Commit 36dceb7

Browse files
committed
test(fix[retry_until]): use monotonic clock
why: avoid timeout flake when wall clock changes during retries. what: - Switch retry loop timing to time.monotonic
1 parent 744e5a7 commit 36dceb7

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/libtmux/test/retry.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,10 @@ def retry_until(
5959
6060
>>> assert retry_until(fn, raises=False)
6161
"""
62-
ini = time.time()
62+
ini = time.monotonic()
6363

6464
while not fun():
65-
end = time.time()
65+
end = time.monotonic()
6666
if end - ini >= seconds:
6767
if raises:
6868
raise WaitTimeout

0 commit comments

Comments
 (0)