[BugFix] Fixed the issue where --no-async-chunk was not working. (#2934)

Signed-off-by: amy-why-3459 <wuhaiyan17@huawei.com>
This commit is contained in:
amy-why-3459 authored and GitHub committed 2026-04-20 13:50:17 +08:00
1 parent d435fe0707
commit 0393c58533
4 files changed
+42 -7

No files matched your search

+23 -1
View File
@@ -7,11 +7,33 @@ import argparse
import pytest
from pytest_mock import MockerFixture
from vllm_omni.entrypoints.cli.serve import run_headless
from vllm_omni.entrypoints.cli.serve import OmniServeCommand, run_headless
from vllm_omni.entrypoints.utils import detect_explicit_cli_keys
pytestmark = [pytest.mark.core_model, pytest.mark.cpu]
def test_serve_parser_accepts_no_async_chunk_and_marks_it_explicit() -> None:
"""``--no-async-chunk`` should parse to ``async_chunk=False`` and mark the
shared deploy-level dest as explicitly provided by the user."""
try:
from vllm.utils.argparse_utils import FlexibleArgumentParser
except Exception as exc:
pytest.skip(f"Cannot build parser in this environment: {exc}")
root = FlexibleArgumentParser()
subparsers = root.add_subparsers(dest="subcommand")
cmd = OmniServeCommand()
serve_parser = cmd.subparser_init(subparsers)
argv = ["serve", "fake-model", "--omni", "--no-async-chunk"]
args = root.parse_args(argv)
assert args.async_chunk is False
explicit = detect_explicit_cli_keys(argv, serve_parser)
assert "async_chunk" in explicit
def _make_headless_args() -> argparse.Namespace:
return argparse.Namespace(
model="fake-model",