From 4057da1c1fd22930fdb791149e85ce9abdd41b0a Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Thu, 4 Apr 2024 09:30:48 +0300 Subject: [PATCH] remote: use `perf_counter()` to measure duration, not `time()` `time()` is not monotonic and is not appropriate for measuring duration. --- src/xdist/remote.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/xdist/remote.py b/src/xdist/remote.py index fc3a3ff..40e0cd7 100644 --- a/src/xdist/remote.py +++ b/src/xdist/remote.py @@ -175,9 +175,9 @@ class WorkerInteractor: worker_title("[pytest-xdist running] %s" % item.nodeid) - start = time.time() + start = time.perf_counter() self.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) - duration = time.time() - start + duration = time.perf_counter() - start worker_title("[pytest-xdist idle]")