Skip to content

[None][fix] Align the serve constructor ratchet with its landing baseline - #22174

Merged
JunyiXu-nv merged 1 commit into
NVIDIA:mainfrom
JunyiXu-nv:dev-junyix-fix-serve-ratchet-baseline
Nov 12, 2026
Merged

JunyiXu-nv merged 1 commit into
NVIDIA:mainfrom
JunyiXu-nv:dev-junyix-fix-serve-ratchet-baseline

Conversation

@JunyiXu-nv

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

Copy link
Copy Markdown
Collaborator

Description

Fix the deterministic failure of test_no_new_object_new_sites on main after #21406 merged.

The guard's snapshot predates two changes that had already landed before the guard itself:

Update only those baseline entries: five missing names and one obsolete name. Their complete per-file site lists are identical immediately before #21406 merged (9ceb00a84e^), at its merge (9ceb00a84e), and at this PR's base (c0468112f4). No site introduced after the guard landed is allowed by this change.

The AST scanner and ratchet logic are unchanged. New construction sites, renamed sites and stale baseline entries still fail. No serving behavior, public API or test selection changes.

Test Coverage

  • Reproduced six baseline diagnostics on c0468112f4; the corrected scan reports none.
  • pytest -p trtllm_stub_ops -p no:cacheprovider -q tests/unittest/serve/test_no_object_new.py: 12 passed with the repository's pytest configuration. The local stub plugin only permits importing the older compiled artifacts; this file's checks operate on Python source.
  • Independently reran the same file without repository conftests or plugin auto-loading: 12 passed. No native artifacts are required for the scanner itself.
  • Historical AST comparison: both affected files have exactly the same sites before the guard's merge, at that merge, and at the current base.
  • Negative checks: restoring the old baseline reproduces the six diagnostics; adding an unapproved site or removing a recorded site still fails. The existing renamed-site self-test still passes.
  • pre-commit run --files tests/unittest/serve/test_no_object_new.py twice: clean. Commit hooks also passed.

The file remains cpu_only and is already collected by the unittest/serve entry in l0_cpu.yml. Review ownership remains with the existing test CODEOWNERS.

PR Checklist

  • PR description clearly explains what and why.
  • PR follows the TRT-LLM coding guidelines.
  • Existing tests and negative checks cover the baseline correction; no new production path is introduced.
  • No public API, dependency, ownership, configuration-schema or architecture changes.
  • Please check this after reviewing the above items as appropriate for this PR.

🤖 Generated with Claude Code

Dev Engineer Review

  • Scope: One file changed, tests/unittest/serve/test_no_object_new.py (+7/-1). The diff edits only the BASELINE mapping. The scanner and ratchet logic are unchanged.
  • Entries added to BASELINE:
    • test_anthropic_routes.py: _disagg_route_client OpenAIDisaggServer, _streaming_chat_server OpenAIServer, test_batched_message_is_named_after_the_executor_client_id OpenAIServer.
    • test_openai_server_graceful_shutdown.py (new mapping key): _config_keywords OpenAIServer, _serve_never_finishing_handler OpenAIServer.
  • Entry removed from BASELINE: _chat_stream OpenAIServer in test_anthropic_routes.py.
  • Risk: The baseline allows these object.__new__ sites in the listed files. Each allowance is a permitted site, so a reviewer should confirm that these sites existed before #21406 merged. The PR objectives state this, but the diff alone does not prove it.
  • No serving behavior, public API, or runtime code changes.

QA Engineer Review

Test files changed:

  • Modified: tests/unittest/serve/test_no_object_new.py. Test functions and test IDs were not changed. The baseline data changed.
  • Not added or removed. No test-list files changed.

Coverage: The guard test checks each file against the baseline. The PR objectives report that pytest -p trtllm_stub_ops -p no:cacheprovider -q tests/unittest/serve/test_no_object_new.py passes with 12 tests, and that a run without repository conftests or plugin auto-loading also passes with 12 tests. Negative checks reportedly confirm that unapproved or removed sites still fail. These results are author-reported. They were not run in this review.

Test-list placement: Not applicable. No test-db/ or qa/ list entries changed.

Verdict: sufficient. The change updates guard data and keeps the guard logic intact. A QA engineer should run the test file once to confirm the 12 passing results.

Per-File QA Perspective

  • tests/unittest/serve/test_no_object_new.py: Updates the object.__new__ ratchet baseline. QA should confirm the test still passes and still fails for newly added unapproved sites. This file is not listed in test-db/ or qa/.

…line

The constructor-site guard added by NVIDIA#21406 recorded an older snapshot of
main. NVIDIA#20936 had already replaced _chat_stream and added two other
Anthropic fixtures, and NVIDIA#21012 had added the graceful-shutdown fixtures.
Their names were missing when the guard landed, so its CPU test fails
with five missing sites and one obsolete entry on current main.

Record only those sites that already existed in the parent of NVIDIA#21406's
merge commit and remove the obsolete name. Keep the scanner and ratchet
logic unchanged: newly added sites and stale allowances still fail.

Signed-off-by: JunyiXu-nv <[email protected]>
@JunyiXu-nv
JunyiXu-nv requested a review from a team as a code owner November 12, 2026 07:39
@JunyiXu-nv
JunyiXu-nv requested review from BowenFu and QiJune November 12, 2026 07:39
@JunyiXu-nv

Copy link
Copy Markdown
Collaborator Author

/bot run

@coderabbitai

coderabbitai Bot commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The BASELINE in test_no_object_new.py now reflects the listed object creation sites for Anthropic route tests and OpenAI server graceful-shutdown tests. It removes one prior entry and adds five entries.

Changes

Object-new baseline correction

Layer / File(s) Summary
Update allowed object creation sites
tests/unittest/serve/test_no_object_new.py
The Anthropic routes baseline removes _chat_stream OpenAIServer and adds three entries. The OpenAI server graceful-shutdown baseline adds two entries.

Estimated code review effort: 2 (Simple) | ~5 minutes

Change: Other

Possibly related PRs

Merge Risk: Minimal · up to 3a13c

This updates a test guard's allowed-site list and does not change serving behavior. No actionable merge-blocking risk remains.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: it aligns the serve constructor ratchet baseline with its landing state. It follows the [None][fix] format from the template and is specific to the changed test file. …
Description check Passed The description follows the repository template in substance. It explains the problem (the guard's snapshot predates #20936 and #21012), the fix (baseline entries only, five added names and one remove…
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: Title check

Explanation

The title names the main change: it aligns the serve constructor ratchet baseline with its landing state. It follows the [None][fix] format from the template and is specific to the changed test file. The title is concise and does not use vague terms. Note that the title says 'serve constructor ratchet' rather than naming the test or the baseline entries, but a reviewer scanning history can still identify the change.

Full details: Description check

Explanation

The description follows the repository template in substance. It explains the problem (the guard's snapshot predates #20936 and #21012), the fix (baseline entries only, five added names and one removed), and the scope (no scanner or behavior change). The Test Coverage section lists specific commands and results. The checklist is filled in and marked. The description does not use the template's exact Description and Test Coverage headings in every detail, and it does not state a JIRA, NVBugs, or GitHub ticket, but it uses [None] in the title, which is valid. The description's claim that 'Pre-commit checks passed' and that test counts match is supported by its own test coverage section. The PR checklist is partially edited and has one box checked, which is acceptable.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between c046811 and 3a13c3a.

Files selected for processing: 1

  • tests/unittest/serve/test_no_object_new.py

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

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #84397 [ run ] triggered by Bot. Commit: 3a13c3a Link to invocation

@github-actions

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.

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #84397 [ run ] completed with state SUCCESS. Commit: 3a13c3a
/LLM/main/L0_MergeRequest_PR pipeline #69798 completed with status: 'SUCCESS'

CI Report

Link to invocation

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