Unverified Commit 3cf1473a authored by Lifu Huang's avatar Lifu Huang Committed by GitHub
Browse files

Use monotonic clock for interval measurement (#6211)


Signed-off-by: default avatarLifu Huang <lifu.hlf@gmail.com>
parent 27168308
...@@ -102,7 +102,7 @@ class TestDisaggregationMooncakeDifferentTP(CustomTestCase): ...@@ -102,7 +102,7 @@ class TestDisaggregationMooncakeDifferentTP(CustomTestCase):
@classmethod @classmethod
def wait_server_ready(cls, url, timeout=60): def wait_server_ready(cls, url, timeout=60):
start_time = time.time() start_time = time.perf_counter()
while True: while True:
try: try:
response = requests.get(url) response = requests.get(url)
...@@ -112,7 +112,7 @@ class TestDisaggregationMooncakeDifferentTP(CustomTestCase): ...@@ -112,7 +112,7 @@ class TestDisaggregationMooncakeDifferentTP(CustomTestCase):
except Exception: except Exception:
pass pass
if time.time() - start_time > timeout: if time.perf_counter() - start_time > timeout:
raise RuntimeError(f"Server {url} failed to start in {timeout}s") raise RuntimeError(f"Server {url} failed to start in {timeout}s")
time.sleep(1) time.sleep(1)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment