loop.time is not usable on advance time, use wall time

This commit is contained in:
Victor Shyba 2021-07-08 03:55:21 -03:00
parent 9b3b609e40
commit c519d4651b

View file

@ -1,4 +1,5 @@
import asyncio
import time
import unittest
import typing
from lbry.testcase import AsyncioTestCase
@ -95,8 +96,8 @@ class TestTemporarilyLosingConnection(AsyncioTestCase):
TIMEOUT = None # not supported as it advances time
async def test_losing_connection(self):
async def wait_for(check_ok, insist, timeout=20):
start = loop.time()
while loop.time() - start < timeout:
start = time.time()
while time.time() - start < timeout:
if check_ok():
break
await asyncio.sleep(0)