Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions python/sglang/test/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,16 @@ def popen_launch_server(
start_time = time.time()
with requests.Session() as session:
while time.time() - start_time < timeout:

# check if server process has crashe/exited
return_code = process.poll()
if return_code is not None:
# Server failed to start (non-zero exit code) or crashed
raise Exception(
f"Server process exited with code {return_code}. "
"Check server logs for errors."
)

try:
headers = {
"Content-Type": "application/json; charset=utf-8",
Expand Down