# PR #45897 完整报告

- 仓库：`vllm-project/vllm`
- 标题：[BugFix][CI] Fix scheduler plugin test
- 合并时间：2026-06-17 14:30
- 原文链接：http://prhub.com.cn/vllm-project/vllm/pull/45897

---

# 执行摘要

- 一句话：修复调度器插件测试因 API 变更失败
- 推荐动作：该 PR 是常规的追踪测试兼容性修复，逻辑简单，无需深入阅读。但值得关注的是，它暴露了 CI 流程中一个问题：PR#44558 的 CI 未运行此测试，反映出测试选择或触发机制可能有盲区。

# 功能与动机

修复 PR#44558 导致的测试 breakage，该测试因未同步更新子类签名而在后续 CI 中失败。PR body 明确指出 "must have not run in the PR‘s CI"。

# 实现拆解

在 `tests/plugins_tests/test_scheduler_plugins.py` 中，将 `DummyV1Scheduler.schedule` 方法的签名从 `def schedule(self)` 更新为 `def schedule(self, throttle_prefills: bool = False)`，以匹配 V1 Scheduler 基类在 PR#44558 中引入的新参数。该变更确保测试继承关系正确，使 `pytest.raises` 断言能按预期捕获异常。

关键文件：
- `tests/plugins_tests/test_scheduler_plugins.py`（模块 测试；类别 test；类型 test-coverage；符号 schedule）: 唯一变更文件，修复了 DummyV1Scheduler.schedule 签名未同步更新导致的测试失败。

关键符号：DummyV1Scheduler.schedule

## 关键源码片段

### `tests/plugins_tests/test_scheduler_plugins.py`

唯一变更文件，修复了 DummyV1Scheduler.schedule 签名未同步更新导致的测试失败。

```python
# tests/plugins_tests/test_scheduler_plugins.py
# 修复：在 DummyV1Scheduler 子类中同步更新 schedule 方法签名，
# 以匹配 PR#44558 中 Scheduler 基类新增的 throttle_prefills 参数。
class DummyV1Scheduler(Scheduler):
    def schedule(self, throttle_prefills: bool = False):
        raise Exception("Exception raised by DummyV1Scheduler")

```

# 评论区精华

无 review 讨论。

- 暂无高价值评论线程

# 风险与影响

- 风险：无技术风险。仅涉及一行测试代码签名调整，逻辑不变。
- 影响：影响限于 `tests/plugins_tests/test_scheduler_plugins.py` 测试文件的正确性。修复后该测试能通过 CI，避免后续开发者遇到 false positive 失败。无用户或生产系统影响。
- 风险标记：暂无

# 关联脉络

- PR #44558 Unknown: 本 PR 修复了 PR#44558 引入的 API 变更导致的测试失败。