Skip to content

[BugFix][Test] Honor max_model_len without token expectations - #24358

Open
Nicko-F wants to merge 2 commits into
vllm-project:mainfrom
Nicko-F:fix/e2e-context-length-limit
Open

Nicko-F wants to merge 2 commits into
vllm-project:mainfrom
Nicko-F:fix/e2e-context-length-limit

Conversation

@Nicko-F

@Nicko-F Nicko-F commented Dec 2, 2026 •

Copy link
Copy Markdown

What this PR does / why we need it?

The single-node chat test passes the server's --max-model-len to validate_response. Empty token expectations currently skip that check. Normalize empty expectations so the existing total-token bound still applies.

Fixes #24357

Project collaborator iamustcfw.

Does this PR introduce any user-facing change?

This change applies to E2E response validation.

How was this patch tested?

  • python -m pytest --noconftest -q tests/ut/tools/test_send_request.py on CPU passed both parameter cases. Both fail against the original helper.
  • The regression file passed mypy for Python 3.10, 3.11 and 3.12.
  • Ruff lint and format checks passed for the changed files. git diff --check passed.

Checklist

  • Regression reproduces the missing upper-bound check.

  • Tests cover an exceeded limit, the inclusive boundary and calls without a limit.

  • vLLM main: vllm-project/vllm@c410543

Check the configured max_model_len even when no expected token counts
are supplied. Cover empty expectations and the inclusive limit in CPU tests.

Signed-off-by: NICKO <[email protected]>

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request updates the validate_response function in tools/send_request.py to ensure that max_model_len checks are still enforced even when the expected parameter is empty or None. It also introduces a comprehensive suite of unit tests in tests/ut/tools/test_send_request.py to verify this behavior and other token validation logic. There are no review comments, and I have no feedback to provide.

@github-actions

github-actions Bot commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

👋 Hi! Thank you for contributing to the vLLM Ascend project. The following points will speed up your PR merge:‌‌

  • A PR should do only one thing, smaller PRs enable faster reviews.
  • Every PR should include unit tests and end-to-end tests ‌to ensure it works and is not broken by other future PRs.
  • Write the commit message by fulfilling the PR description to help reviewer and future developers understand.

If CI fails, you can run linting and testing checks locally according Contributing and Testing.

🤖 How to trigger CI

CI runs automatically when the PR is opened or reopened. Pushing a new commit no longer re-runs the E2E CI (to save NPU runner resources), so use the comment commands below when needed. They are available to the PR author and users with triage permission or above:

  • /run — run the full PR CI gate on the latest commit.
  • /rerun — re-run the failed CI jobs (e.g. after a flaky failure).
  • /e2e — run selected E2E tests instead of the full gate.
  • /nightly / /presmoke / /weekly — run the corresponding large-scale tests (triage permission or above; blocked during the nightly maintenance window).
  • /cancel — cancel a running CI on this PR.

Note

Until the CI gate has run on a commit, the required ci-gate check stays pending and the PR cannot merge — remember to comment /run after pushing.


Tip

💡 Consider Linking a Related Issue or RFC

Your PR title contains the [BugFix] tag, indicating a bug fix or new feature.

Linking a related issue or RFC in the PR description is strongly encouraged — it gives reviewers helpful context and speeds up the review. You can use any of these keywords:

  • Fixes #<issue_number>
  • Closes #<issue_number>
  • Resolves #<issue_number>
  • Refs #<rfc_or_issue_number> (for RFCs)

🙏 Thanks for helping us keep the project well-organized!

@github-actions

github-actions Bot commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

Last updated: 2026-12-02 21:47 UTC+8 for commit a158e3f.

ci-gate failed. Reason:

pre-commit failed (lint / markdownlint / mypy / gitleaks). Open the failed 'pre-commit' job above, fix the reported issues in your PR, and push again. No test label is needed for this failure.

See the workflow run for full logs. This comment is updated in place on each new failure and marked as passed once the gate passes (it is kept for history, not deleted).

Use the tools test suite's pytest parameter style for empty and missing
expectations so all supported mypy targets can infer the input type.

Signed-off-by: NICKO <[email protected]>

Nicko-F commented Dec 2, 2026 •

Copy link
Copy Markdown
Author

/run
[Bot]: run command accepted. E2E has been queued on the latest commit 4c66cd3965b0e80635ce8810d903de932b1b0b7c of this PR, with whatever test-scope labels the PR currently carries. Track progress in PR checks.

@vllm-ascend-ci vllm-ascend-ci added the ci-run E2E requested manually on the latest commit label Dec 2, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-run E2E requested manually on the latest commit module:tests module:tools

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: E2E token usage validation skips max_model_len when expected_response is empty

2 participants