From c519d4651bf44df18561345615446455e9b2d3fd Mon Sep 17 00:00:00 2001 From: Victor Shyba Date: Thu, 8 Jul 2021 03:55:21 -0300 Subject: [PATCH] loop.time is not usable on advance time, use wall time --- tests/unit/dht/test_node.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/unit/dht/test_node.py b/tests/unit/dht/test_node.py index 5c502f9a7..75f999a75 100644 --- a/tests/unit/dht/test_node.py +++ b/tests/unit/dht/test_node.py @@ -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)