mirror of
https://github.com/python/cpython.git
synced 2025-11-09 01:51:26 +00:00
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).
This commit is contained in:
parent
4e80f5cbea
commit
2cf4c202ff
14 changed files with 68 additions and 66 deletions
|
|
@ -1131,12 +1131,12 @@ def my_url_handler(url, content_type):
|
|||
serverthread = pydoc._start_server(my_url_handler, hostname='0.0.0.0', port=0)
|
||||
self.assertIn('0.0.0.0', serverthread.docserver.address)
|
||||
|
||||
starttime = time.time()
|
||||
starttime = time.monotonic()
|
||||
timeout = 1 #seconds
|
||||
|
||||
while serverthread.serving:
|
||||
time.sleep(.01)
|
||||
if serverthread.serving and time.time() - starttime > timeout:
|
||||
if serverthread.serving and time.monotonic() - starttime > timeout:
|
||||
serverthread.stop()
|
||||
break
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue