-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
write to /dev/termination-log on main loop exception.
This includes picking up server config errors, but does NOT make any attempt in recovering exception stacks happening inside vllm's RPC server, as they're raised in a separate process, other than reporting a RuntimeError.
- Loading branch information
1 parent
047f767
commit 355a088
Showing
5 changed files
with
99 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import pytest | ||
|
||
from .utils import TaskFailedError | ||
|
||
|
||
@pytest.fixture | ||
def termination_log_fpath(tmp_path, monkeypatch): | ||
# create termination log before server starts | ||
temp_file = tmp_path / "termination_log.txt" | ||
monkeypatch.setenv("TERMINATION_LOG_DIR", str(temp_file)) | ||
yield temp_file | ||
temp_file.unlink(missing_ok=True) | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"server_args", | ||
[ | ||
pytest.param(["--enable-lora"], id="enable-lora"), | ||
pytest.param(["--max-model-len=10241024"], id="huge-model-len"), | ||
pytest.param(["--model=google-bert/bert-base-uncased"], id="unsupported-model"), | ||
], | ||
indirect=True, | ||
) | ||
def test_startup_fails(request, args, termination_log_fpath, lora_available): | ||
"""Test that common set-up errors crash the server on startup. | ||
These errors should be properly reported in the termination log. | ||
""" | ||
if lora_available and args.enable_lora: | ||
pytest.skip("This test requires a non-lora supported device to run") | ||
|
||
# Server fixture is called explicitly so that we can handle thrown exception | ||
with pytest.raises(TaskFailedError): | ||
_ = request.getfixturevalue("_servers") | ||
|
||
# read termination logs | ||
assert termination_log_fpath.exists() |