Skip to content

[TRTLLM-17557][test] Run the SMG single-frontend guard test in the CPU stage - #21413

Merged
JunyiXu-nv merged 1 commit into
NVIDIA:mainfrom
JunyiXu-nv:dev-junyix-feat-serve-register-grpc-frontend-test
Nov 2, 2026
Merged

JunyiXu-nv merged 1 commit into
NVIDIA:mainfrom
JunyiXu-nv:dev-junyix-feat-serve-register-grpc-frontend-test

Conversation

@JunyiXu-nv

@JunyiXu-nv JunyiXu-nv commented Nov 2, 2026 •

Copy link
Copy Markdown
Collaborator

Dev Engineer Review

  • The change adds one existing test ID to l0_cpu.yml. No product code or test code changes.
  • The entry follows test_smg_server_startup_failure_cleans_up, as intended. No unintended scope changes are evident.
  • Test results and validation status were not provided.

QA Engineer Review

  • l0_cpu.yml adds unittest/grpc/test_grpc_optional.py::test_smg_rejects_multiple_frontends_before_engine_start.
  • The registered test covers rejection of multiple gRPC frontends through both CLI arguments and a config-file override. It checks that serving exits with an error and reports the expected message.
  • The test is listed in the CPU CI test database. Coverage verdict: sufficient for this test-list-only change.

Per-File QA Perspective

  • tests/integration/test_lists/test-db/l0_cpu.yml: Adds the test ID to the CPU CI list. This changes CI test selection; it does not change test behavior or manual-QA lists.

Description

tests/unittest/grpc/test_grpc_optional.py::test_smg_rejects_multiple_frontends_before_engine_start is marked pytest.mark.cpu_only, but the file is registered only in l0_a10.yml, whose stage runs unit tests with -m "not cpu_only" — so this test currently runs nowhere in CI. #19760 registered the file's five other cpu_only tests as node ids in l0_cpu.yml, but not this one.

The test runs trtllm-serve <model dir> --grpc with --num_serve_frontends 4 (once as a CLI flag, once through a --config YAML, 2 items) and expects a non-zero exit with "Multiple gRPC frontends require --grpc-protocol openengine" from the guard in _serve_llm, before any engine starts. No GPU and no model files are needed: it writes a minimal config.json into tmp_path, and --gpus_per_node 1 keeps get_llm_args from calling device_count().

This PR adds the test's node id to l0_cpu.yml right after the file's last registered node id (test_smg_server_startup_failure_cleans_up), keeping the node ids in the order of the tests in the file. A node id, not a file entry, follows the pattern #19760 established for this file's cpu_only tests.

Coordination with open PRs touching the same lines or file:

Upcoming trtllm-serve refactor PRs under epic TRTLLM-17056 split tensorrt_llm/commands/serve.py into a CLI package, retargeting the from tensorrt_llm.commands.serve import serve import inside this test and the launcher code the test exercises; registering the test first means CI checks those updates instead of merging edits to a test that never runs.

No product or test code changes — one line in one test list.

Behavior

No behavior change. The l0_a10.yml file entry is untouched: the A10 stage keeps running the file's non-cpu_only tests and keeps deselecting this one.

CI bookkeeping

  • Test lists: tests/integration/test_lists/test-db/l0_cpu.yml gains unittest/grpc/test_grpc_optional.py::test_smg_rejects_multiple_frontends_before_engine_start after ...::test_smg_server_startup_failure_cleans_up, before unittest/inputs.
  • Multi-GPU trigger table, CODEOWNERS, legacy-files.txt: no changes needed.

Test Coverage

Local run on a GPU-less dev container, exactly as the CPU stage runs the entry. The Python code under test is this branch via a PYTHONPATH overlay — python3 -c "import tensorrt_llm; print(tensorrt_llm.__file__)" printed this checkout's path — over compiled extensions from a source build of main at 5d86481f60 (TensorRT-LLM 1.4.0rc3); the test spawns the trtllm-serve CLI from this branch's Python.

  • pytest -m cpu_only -rs "tests/unittest/grpc/test_grpc_optional.py::test_smg_rejects_multiple_frontends_before_engine_start" -q → 2 passed, 13 warnings in 4.22s.
  • Whole file as the CPU stage collects it: pytest -m cpu_only -rs tests/unittest/grpc/test_grpc_optional.py -q → 13 passed, 5 deselected, 24 warnings in 76.52s; -rs reported no skips. The 5 deselected items are the file's non-cpu_only tests, which stay on the A10 stage.
  • python3 scripts/test_to_stage_mapping.py --tests "unittest/grpc/test_grpc_optional.py::test_smg_rejects_multiple_frontends_before_engine_start" → CPU-Generic-arm-1, CPU-Generic-arm-2, CPU-Generic-x86-1, CPU-Generic-x86-2.
  • python3 scripts/check_test_list.py --validate → OK: 2089 unique test entries validated. (one more node-id entry than before this PR); python3 scripts/check_test_list.py --l0 passes.
  • grep -c "pytest.mark.cpu_only" tests/unittest/grpc/test_grpc_optional.py → 6. What makes this entry run (and fail loudly if it stops running): the test carries the cpu_only marker, so the stage's -m cpu_only selects it, and pytest exits with code 5 when an entry collects nothing, which fails the stage. (The literal-text grep matters for directory entries: tests/unittest/conftest.py::pytest_ignore_collect drops marker-less files during directory traversal, but a node id passed directly on the command line, as this entry is, is collected regardless.)
  • git diff --stat → one file, one line added.
  • pre-commit run --files tests/integration/test_lists/test-db/l0_cpu.yml → all hooks pass, twice (the test-list AST validation hook checks the node id resolves to a real test).

After CI: the CPU-Generic stage logs should show test_unittests_v2[unittest/grpc/test_grpc_optional.py::test_smg_rejects_multiple_frontends_before_engine_start] with 2 items, both passed.

PR Checklist

Please review the following before submitting your PR:

  • PR description clearly explains what and why. If using CodeRabbit's summary, please make sure it makes sense.

  • PR Follows TRT-LLM CODING GUIDELINES to the best of your knowledge.

  • Test cases are provided for new code paths (see test instructions)

  • If PR introduces API changes, an appropriate PR label is added - either api-compatible or api-breaking. For api-breaking, include BREAKING in the PR title.

  • Any new dependencies have been scanned for license and vulnerabilities

  • CODEOWNERS updated if ownership changes

  • Documentation updated as needed

  • Update tava architecture diagram if there is a significant design change in PR.

  • The reviewers assigned automatically/manually are appropriate for the PR.

  • Please check this after reviewing the above items as appropriate for this PR.

🤖 Generated with Claude Code

…U stage

test_grpc_optional.py::test_smg_rejects_multiple_frontends_before_engine_start
is marked pytest.mark.cpu_only, but the file is registered only in
l0_a10.yml, whose stage deselects cpu_only tests, so this test runs
nowhere in CI. Register its node id in l0_cpu.yml, after the file's
five other cpu_only node ids that NVIDIA#19760 already registered there.
No GPU and no model files are needed; it passes locally: 2 passed.

Signed-off-by: JunyiXu-nv <219237550+JunyiXu-nv@users.noreply.github.com>
@JunyiXu-nv

Copy link
Copy Markdown
Collaborator Author

/bot run

@coderabbitai

coderabbitai Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 1989cf4 and 2c01769.

Files selected for processing: 1
  • tests/integration/test_lists/test-db/l0_cpu.yml

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 9 remain after this review.

Walkthrough

The CPU integration test list now includes test_smg_rejects_multiple_frontends_before_engine_start.

Changes

CPU test coverage

Layer / File(s) Summary
Add test to CPU integration list
tests/integration/test_lists/test-db/l0_cpu.yml
The list includes the test for rejecting multiple frontends before engine start.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Change: Other

Suggested reviewers: litaotju

Merge Risk: Minimal · up to 2c017

This registration is mergeable; it enables the intended CPU test coverage without changing product behavior.

Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title clearly identifies the ticket, test change, and CPU-stage execution. It accurately summarizes the primary change.
Description check Passed The description follows the required template and explains the issue, solution, test coverage, CI bookkeeping, and checklist status. It provides sufficient technical detail for review.
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 0 files. (1 skipped: 1 unsupported.)

Finishing Touches
Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #81911 [ run ] triggered by Bot. Commit: 2c01769 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #81911 [ run ] completed with state SUCCESS. Commit: 2c01769
/LLM/main/L0_MergeRequest_PR pipeline #67559 completed with status: 'SUCCESS'

CI Report

Link to invocation

@brnguyen2 brnguyen2 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving — the comments below are optional touch-ups, not blockers.

The node id matches test_smg_rejects_multiple_frontends_before_engine_start at tests/unittest/grpc/test_grpc_optional.py:359, which is marked cpu_only. That marker keeps it out of the A10 stage, so adding it here is the only way it runs in CI.

One fix to the description: the "Test Coverage" section ends mid-sentence at "Local run on". Please finish it with the environment and the pytest result (2 params passing). Without that, nothing shows the test passes in a CPU-only container before it becomes a gating L0 test.

@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown

Automatically added "ci: full pre-merge approved" because this PR has satisfied the required GitHub review approvals. Unresolved review conversations and other required checks remain independent merge requirements.

@JunyiXu-nv
JunyiXu-nv merged commit b1352a7 into NVIDIA:main Nov 2, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants