Prhub

#42013 [CI][XPU] Skip fork-dependent logits processor test

原始 PR 作者 zhenwei-intel 合并时间 2026-05-08 21:10 文件变更 1 提交数 4 评论 2 代码增减 +1 / -1

执行摘要

跳过 fork 依赖的 CPU logits 测试以修复 Intel CI

XPU 不支持 fork,导致依赖 fork 的 logits processor 测试 (test_custom_offline.py) 在 Intel CI 中失败。PR body 直接说明了原因:"XPU does not support fork, causing the CI to fail, so this PR skips the fork-dependent test."

此 PR 是简单的 CI 修复,无需精读。但可关注 future improvement:将条件跳过逻辑迁移到测试文件内部,使用环境变量判断 XPU 并 skip,提高可维护性。

讨论亮点

Review 评论中,gemini-code-assist[bot] 建议改用 pytest markers 在测试文件内部条件跳过,认为这样更利于维护。但最终 PR 采用了 CI 配置层面的忽略方式,并在 jikunshang 批准后合并。

实现拆解

  1. 修改 Intel CI 配置文件 .buildkite/intel_jobs/misc_intel.yaml,在 v1/logits_processors 测试的 pytest 命令中添加 --ignore=v1/logits_processors/test_custom_online.py --ignore=v1/logits_processors/test_custom_offline.py 参数。
  2. 该变更仅影响 Intel GPU (XPU) 的 CI 流水线,对其它平台无影响。
  3. 提交历史显示经过两次修正才确定忽略文件列表,最终同时忽略了 online 和 offline 两个文件。
文件 模块 状态 重要度
.buildkite/intel_jobs/misc_intel.yaml CI 配置 modified 2.9

关键源码片段

.buildkite/intel_jobs/misc_intel.yaml configuration

Intel CI 配置文件中修改了 pytest 命令,添加 --ignore 参数以跳过两个 fork 依赖的测试文件。

# .buildkite/intel_jobs/misc_intel.yaml
# 变更:在 Intel GPU CI 的 logits processors 测试步骤中,
# 跳过依赖 fork 的测试文件,避免 XPU 不支持 fork 导致的失败
commands:
  - >-
    bash .buildkite/scripts/hardware_ci/run-intel-test.sh
    'export VLLM_WORKER_MULTIPROC_METHOD=spawn &&
    cd tests &&
    # 跳过 online 和 offline 两个依赖 fork 的测试
    pytest -v -s v1/logits_processors
      --ignore=v1/logits_processors/test_custom_online.py
      --ignore=v1/logits_processors/test_custom_offline.py &&
    pytest -v -s v1/test_oracle.py &&
    pytest -v -s v1/test_request.py &&
    pytest -v -s v1/test_outputs.py'

评论区精华

使用 pytest markers 替代 CI --ignore 设计

gemini-code-assist[bot] 建议在测试文件内部使用 pytest markers 条件跳过,而不是在 CI 配置中使用 --ignore,以提高可维护性。

结论:未采纳该建议,最终仍使用 --ignore 方式。 · unresolved

风险与影响

低风险。仅影响 Intel CI 的测试执行命令,不影响任何生产代码。忽略的测试文件在其他平台上仍会运行。但建议未来考虑在测试文件内使用 pytest.mark.skipif 条件跳过,以避免 CI 配置与测试逻辑的耦合。

影响范围很小,仅 Intel GPU (XPU) CI 不再运行 test_custom_offline.pytest_custom_online.py,从而避免了 fork 相关失败。对于其他平台无影响。

CI 配置与测试逻辑耦合 低风险

关联 Issue

未识别关联 Issue

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

完整报告

参与讨论