Skip to content

Commit 1892433

Browse files
committed
[Test] fix ci
1 parent 7afa06a commit 1892433

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

tests/entrypoints/openai/test_api_server.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -667,12 +667,23 @@ def test_launchers_and_controller():
667667
with pytest.raises(Exception):
668668
api_server.launch_api_server()
669669

670+
# workers > 1 branch: StandaloneApplication
671+
api_server.args.workers = 2
670672
with (
671673
patch("fastdeploy.entrypoints.openai.api_server.is_port_available", return_value=True),
672674
patch("fastdeploy.entrypoints.openai.api_server.StandaloneApplication.run", side_effect=RuntimeError("fail")),
673675
):
674676
api_server.launch_api_server()
675677

678+
# workers == 1 branch: uvicorn.run
679+
api_server.args.workers = 1
680+
with (
681+
patch("fastdeploy.entrypoints.openai.api_server.is_port_available", return_value=True),
682+
patch("fastdeploy.entrypoints.openai.api_server.uvicorn.run", side_effect=RuntimeError("fail")) as uv_run,
683+
):
684+
api_server.launch_api_server()
685+
uv_run.assert_called_once()
686+
676687
with patch("fastdeploy.entrypoints.openai.api_server.uvicorn.run") as uv_run:
677688
api_server.run_metrics_server()
678689
api_server.run_controller_server()

0 commit comments

Comments
 (0)