summaryrefslogtreecommitdiffstats
path: root/Lib/test/support
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@redhat.com>2018-12-17 08:36:36 (GMT)
committerGitHub <noreply@github.com>2018-12-17 08:36:36 (GMT)
commit2cf4c202ffeb30787c944365ba54013688b854c2 (patch)
treeaa98e69de819cb1cd0f5bd25fb10636f98001ff2 /Lib/test/support
parent4e80f5cbeaee87a26e49bc9623c92a10e28dbbd9 (diff)
downloadcpython-2cf4c202ffeb30787c944365ba54013688b854c2.zip
cpython-2cf4c202ffeb30787c944365ba54013688b854c2.tar.gz
cpython-2cf4c202ffeb30787c944365ba54013688b854c2.tar.bz2
bpo-35513: Replace time.time() with time.monotonic() in tests (GH-11182)
Replace time.time() with time.monotonic() in tests to measure time delta. test_zipfile64: display progress every minute (60 secs) rather than every 5 minutes (5*60 seconds).
Diffstat (limited to 'Lib/test/support')
-rw-r--r--Lib/test/support/__init__.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py
index 9b6c338..9ffb04d 100644
--- a/Lib/test/support/__init__.py
+++ b/Lib/test/support/__init__.py
@@ -2259,11 +2259,11 @@ def start_threads(threads, unlock=None):
try:
if unlock:
unlock()
- endtime = starttime = time.time()
+ endtime = starttime = time.monotonic()
for timeout in range(1, 16):
endtime += 60
for t in started:
- t.join(max(endtime - time.time(), 0.01))
+ t.join(max(endtime - time.monotonic(), 0.01))
started = [t for t in started if t.isAlive()]
if not started:
break