-
Notifications
You must be signed in to change notification settings - Fork 86
test(vllm): drop tests of APIs removed by PR #22 refactor #43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -83,7 +83,6 @@ def fake_post(endpoint: str, payload: dict, timeout: float): | |||||||||||||||
| assert len(calls) == 1 | ||||||||||||||||
| assert calls[0][0] == "start_weight_update" | ||||||||||||||||
| assert calls[0][1] == {"is_checkpoint_format": True} | ||||||||||||||||
| assert calls[0][2] == vllm_engine._weight_transfer_http_timeout() | ||||||||||||||||
|
|
||||||||||||||||
|
|
||||||||||||||||
| @pytest.mark.unit | ||||||||||||||||
|
|
@@ -99,7 +98,9 @@ def fake_post(endpoint: str, payload: dict, timeout: float): | |||||||||||||||
| result = vllm_engine.finish_weight_update() | ||||||||||||||||
|
|
||||||||||||||||
| assert result == {"done": True} | ||||||||||||||||
| assert calls == [("finish_weight_update", {}, vllm_engine._weight_transfer_http_timeout())] | ||||||||||||||||
| assert len(calls) == 1 | ||||||||||||||||
| assert calls[0][0] == "finish_weight_update" | ||||||||||||||||
| assert calls[0][1] == {} | ||||||||||||||||
|
Comment on lines
+101
to
+103
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Instead of dropping the timeout assertion, we should verify that the default timeout of
Suggested change
|
||||||||||||||||
|
|
||||||||||||||||
|
|
||||||||||||||||
| @pytest.mark.unit | ||||||||||||||||
|
|
@@ -152,56 +153,6 @@ def fake_post(endpoint: str, payload: dict, timeout: float): | |||||||||||||||
| assert seen[0][1] == {"update_info": {"names": ["w"], "packed": False}} | ||||||||||||||||
|
|
||||||||||||||||
|
|
||||||||||||||||
| @pytest.mark.unit | ||||||||||||||||
| def test_weight_transfer_http_timeout_reads_env(vllm_engine, monkeypatch): | ||||||||||||||||
| monkeypatch.setenv("SLIME_VLLM_WEIGHT_TRANSFER_UPDATE_TIMEOUT_SEC", "123.5") | ||||||||||||||||
| assert vllm_engine._weight_transfer_http_timeout() == 123.5 | ||||||||||||||||
|
|
||||||||||||||||
|
|
||||||||||||||||
| @pytest.mark.unit | ||||||||||||||||
| def test_weight_transfer_http_timeout_fallback_to_legacy_env(vllm_engine, monkeypatch): | ||||||||||||||||
| monkeypatch.delenv("SLIME_VLLM_WEIGHT_TRANSFER_UPDATE_TIMEOUT_SEC", raising=False) | ||||||||||||||||
| monkeypatch.setenv("SLIME_VLLM_WEIGHT_TRANSFER_HTTP_TIMEOUT_SEC", "42") | ||||||||||||||||
| assert vllm_engine._weight_transfer_http_timeout() == 42.0 | ||||||||||||||||
|
|
||||||||||||||||
|
|
||||||||||||||||
| @pytest.mark.unit | ||||||||||||||||
| def test_response_json_or_fallback_parses_dict(): | ||||||||||||||||
| response = _MockResponse(json_data={"status": "ready"}) | ||||||||||||||||
| assert mod._response_json_or_fallback(response) == {"status": "ready"} | ||||||||||||||||
|
|
||||||||||||||||
|
|
||||||||||||||||
| @pytest.mark.unit | ||||||||||||||||
| def test_response_json_or_fallback_non_dict_wrapped(): | ||||||||||||||||
| response = _MockResponse() | ||||||||||||||||
| response.json = lambda: ["a", "b"] # type: ignore[method-assign] | ||||||||||||||||
| assert mod._response_json_or_fallback(response) == { | ||||||||||||||||
| "ok": False, | ||||||||||||||||
| "error": "Response is not a dictionary", | ||||||||||||||||
| "data": ["a", "b"], | ||||||||||||||||
| } | ||||||||||||||||
|
|
||||||||||||||||
|
|
||||||||||||||||
| @pytest.mark.unit | ||||||||||||||||
| def test_response_json_or_fallback_invalid_json(): | ||||||||||||||||
| response = _MockResponse(text="not-json") | ||||||||||||||||
| response.json = lambda: (_ for _ in ()).throw(ValueError("no json")) # type: ignore[method-assign] | ||||||||||||||||
| assert mod._response_json_or_fallback(response) == { | ||||||||||||||||
| "ok": False, | ||||||||||||||||
| "error": "Invalid JSON response", | ||||||||||||||||
| "raw": "not-json", | ||||||||||||||||
| } | ||||||||||||||||
|
|
||||||||||||||||
|
|
||||||||||||||||
| @pytest.mark.unit | ||||||||||||||||
| def test_http_base_requires_init(vllm_args): | ||||||||||||||||
| from slime.backends.vllm_utils.vllm_engine import VLLMEngine | ||||||||||||||||
|
|
||||||||||||||||
| engine = VLLMEngine(vllm_args, rank=0) | ||||||||||||||||
| with pytest.raises(RuntimeError, match="init\\(\\)"): | ||||||||||||||||
| engine._http_base() | ||||||||||||||||
|
|
||||||||||||||||
|
|
||||||||||||||||
| @pytest.mark.unit | ||||||||||||||||
| def test_http_base_ipv6_host(vllm_engine): | ||||||||||||||||
| vllm_engine.server_host = "[2001:db8::1]" | ||||||||||||||||
|
|
||||||||||||||||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of completely removing the timeout assertion, we should verify that the default timeout of
900.0seconds is correctly passed to the_post_jsoncall.