Use monotonic clock for interval measurement (#6211)
Signed-off-by: Lifu Huang <lifu.hlf@gmail.com>
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user