Prhub

#45897 [BugFix][CI] Fix scheduler plugin test

原始 PR 作者 njhill 合并时间 2026-06-17 14:30 文件变更 1 提交数 1 评论 0 代码增减 +1 / -1

执行摘要

修复调度器插件测试因 API 变更失败

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

该 PR 是常规的追踪测试兼容性修复,逻辑简单,无需深入阅读。但值得关注的是,它暴露了 CI 流程中一个问题:PR#44558 的 CI 未运行此测试,反映出测试选择或触发机制可能有盲区。

讨论亮点

无 review 讨论。

实现拆解

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 测试 modified 4.26

关键符号

DummyV1Scheduler.schedule

关键源码片段

tests/plugins_tests/test_scheduler_plugins.py test-coverage

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

# 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")

评论区精华

没有提炼出高价值讨论线程

当前评论区没有形成足够清晰的争议点或结论,后续有更多讨论时会体现在这里。

风险与影响

无技术风险。仅涉及一行测试代码签名调整,逻辑不变。

影响限于 tests/plugins_tests/test_scheduler_plugins.py 测试文件的正确性。修复后该测试能通过 CI,避免后续开发者遇到 false positive 失败。无用户或生产系统影响。

关联 Issue

未识别关联 Issue

当前没有检测到明确关联的 Issue 链接,后续同步到相关引用后会出现在这里。

完整报告

参与讨论