mirror of
https://git.datalinker.icu/vllm-project/vllm.git
synced 2025-12-11 11:35:44 +08:00
[CI/Build] Simplify exception trace in api server tests (#9787)
Signed-off-by: youkaichao <youkaichao@gmail.com> Co-authored-by: youkaichao <youkaichao@gmail.com>
This commit is contained in:
parent
c2cd1a2142
commit
00d91c8a2c
@ -133,15 +133,19 @@ class RemoteOpenAIServer:
|
|||||||
try:
|
try:
|
||||||
if requests.get(url).status_code == 200:
|
if requests.get(url).status_code == 200:
|
||||||
break
|
break
|
||||||
except Exception as err:
|
except Exception:
|
||||||
|
# this exception can only be raised by requests.get,
|
||||||
|
# which means the server is not ready yet.
|
||||||
|
# the stack trace is not useful, so we suppress it
|
||||||
|
# by using `raise from None`.
|
||||||
result = self.proc.poll()
|
result = self.proc.poll()
|
||||||
if result is not None and result != 0:
|
if result is not None and result != 0:
|
||||||
raise RuntimeError("Server exited unexpectedly.") from err
|
raise RuntimeError("Server exited unexpectedly.") from None
|
||||||
|
|
||||||
time.sleep(0.5)
|
time.sleep(0.5)
|
||||||
if time.time() - start > timeout:
|
if time.time() - start > timeout:
|
||||||
raise RuntimeError(
|
raise RuntimeError(
|
||||||
"Server failed to start in time.") from err
|
"Server failed to start in time.") from None
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def url_root(self) -> str:
|
def url_root(self) -> str:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user