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)