Use monotonic clock for interval measurement (#6211)

Signed-off-by: Lifu Huang <lifu.hlf@gmail.com>
This commit is contained in:
Lifu Huang
2025-05-17 16:49:18 -07:00
committed by GitHub
parent 2716830802
commit 3cf1473a09
21 changed files with 72 additions and 72 deletions

View File

@@ -97,7 +97,7 @@ class TestDisaggregationMooncake(CustomTestCase):
@classmethod
def wait_server_ready(cls, url, timeout=60):
start_time = time.time()
start_time = time.perf_counter()
while True:
try:
response = requests.get(url)
@@ -107,7 +107,7 @@ class TestDisaggregationMooncake(CustomTestCase):
except Exception:
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")
time.sleep(1)

View File

@@ -102,7 +102,7 @@ class TestDisaggregationMooncakeDifferentTP(CustomTestCase):
@classmethod
def wait_server_ready(cls, url, timeout=60):
start_time = time.time()
start_time = time.perf_counter()
while True:
try:
response = requests.get(url)
@@ -112,7 +112,7 @@ class TestDisaggregationMooncakeDifferentTP(CustomTestCase):
except Exception:
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")
time.sleep(1)