@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / 00d91c8a2c
Fork 0

A high-throughput and memory-efficient inference and serving engine for LLMs

Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git

Synced Nov 16, 09:30 UTC

[CI/Build] Simplify exception trace in api server tests (#9787)

Signed-off-by: youkaichao <youkaichao@gmail.com> Co-authored-by: youkaichao <youkaichao@gmail.com>

Yongzao committed Oct 31, 2024 at 05:52 UTC 00d91c8a2cf3ebaf0f3ea69312f6e3882ed9f372
1 file changed +7 -3
tests/utils.py
+7 -3
@@ -133,15 +133,19 @@ class RemoteOpenAIServer:
133 try:
134 if requests.get(url).status_code == 200:
135 break
136 - except Exception as err:
136 + except Exception:
137 + # this exception can only be raised by requests.get,
138 + # which means the server is not ready yet.
139 + # the stack trace is not useful, so we suppress it
140 + # by using `raise from None`.
141 result = self.proc.poll()
142 if result is not None and result != 0:
139 - raise RuntimeError("Server exited unexpectedly.") from err
143 + raise RuntimeError("Server exited unexpectedly.") from None
144
145 time.sleep(0.5)
146 if time.time() - start > timeout:
147 raise RuntimeError(
144 - "Server failed to start in time.") from err
148 + "Server failed to start in time.") from None
149
150 @property
151 def url_root(self) -> str: