Skip to content

[CI]【Hackathon 10th Spring No.36】worker_process unit test [cf]#7694

Open
ghost wants to merge 1 commit intoPaddlePaddle:developfrom
CloudForge-Solutions:task/h10-036-worker-process-test-v3
Open

[CI]【Hackathon 10th Spring No.36】worker_process unit test [cf]#7694
ghost wants to merge 1 commit intoPaddlePaddle:developfrom
CloudForge-Solutions:task/h10-036-worker-process-test-v3

Conversation

@ghost
Copy link
Copy Markdown

@ghost ghost commented May 2, 2026

placeholder

@ghost ghost temporarily deployed to Metax_ci May 2, 2026 16:40 — with GitHub Actions Inactive
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented May 2, 2026

CLA assistant check
All committers have signed the CLA.

@paddle-bot
Copy link
Copy Markdown

paddle-bot Bot commented May 2, 2026

Thanks for your contribution!

PaddlePaddle-bot

This comment was marked as outdated.

@ghost ghost temporarily deployed to Metax_ci May 2, 2026 16:45 — with GitHub Actions Inactive
@PaddlePaddle-bot
Copy link
Copy Markdown

PaddlePaddle-bot commented May 2, 2026

🤖 Paddle-CI-Agent | ci_status_monitor | 2026-05-03 21:57:39

CI报告基于以下代码生成(30分钟更新一次):


1 任务总览

当前 2 个已执行任务全部通过,无 Required 任务失败。但有 7 个 Workflow 处于 action_required 状态(含主测试任务 PR Build and Test),等待人工审批后才会执行。

总执行(rerun次数) 总任务 ✅ 通过 ❌ 失败 ⏳ 运行中 ⏸️ 等待中 跳过
2(0) 2 2 0 0 0 0

⚠️ 注意:以下 7 个 Workflow 处于 action_required 状态(等待审批后才会执行):Check PR TemplateApprovalCodestyle-CheckCI_HPUILUVATAR-CICI_XPUPR Build and Test。这些 Workflow 需人工审批触发。

注意:action_required workflows 不计入上表的任务统计。


2 任务状态汇总

2.1 Required 任务:0/0 通过

必选任务阻塞合并,失败需优先处理。

当前未检测到 Required 任务(GitHub Branch Protection Rules 中未配置,或 API 权限不足)。

2.2 可选任务 — 2/2 通过

可选任务不阻塞合并,失败仅供参考。

状态 任务 耗时 日志 重跑
其余 2 个可选任务通过 - - -

3 失败详情(仅 required)

无 required 失败任务。

@ghost ghost temporarily deployed to Metax_ci May 2, 2026 17:14 — with GitHub Actions Inactive
@ghost ghost temporarily deployed to Metax_ci May 2, 2026 17:14 — with GitHub Actions Inactive
@ghost ghost temporarily deployed to Metax_ci May 2, 2026 17:14 — with GitHub Actions Inactive
@ghost ghost temporarily deployed to Metax_ci May 2, 2026 17:14 — with GitHub Actions Inactive
@ghost ghost temporarily deployed to Metax_ci May 2, 2026 17:14 — with GitHub Actions Inactive
@ghost ghost temporarily deployed to Metax_ci May 2, 2026 17:14 — with GitHub Actions Inactive
@ghost ghost temporarily deployed to Metax_ci May 2, 2026 17:14 — with GitHub Actions Inactive
@ghost ghost temporarily deployed to Metax_ci May 2, 2026 17:14 — with GitHub Actions Inactive
@ghost ghost temporarily deployed to Metax_ci May 2, 2026 17:15 — with GitHub Actions Inactive
@ghost ghost temporarily deployed to Metax_ci May 2, 2026 17:15 — with GitHub Actions Inactive
@ghost ghost temporarily deployed to Metax_ci May 2, 2026 17:15 — with GitHub Actions Inactive
@ghost ghost temporarily deployed to Metax_ci May 2, 2026 17:15 — with GitHub Actions Inactive
@ghost ghost temporarily deployed to Metax_ci May 2, 2026 17:15 — with GitHub Actions Inactive
@ghost ghost temporarily deployed to Metax_ci May 2, 2026 17:15 — with GitHub Actions Inactive
@ghost ghost temporarily deployed to Metax_ci May 2, 2026 17:15 — with GitHub Actions Inactive
@ghost ghost temporarily deployed to Metax_ci May 2, 2026 17:15 — with GitHub Actions Inactive
@ghost ghost temporarily deployed to Metax_ci May 2, 2026 17:15 — with GitHub Actions Inactive
@ghost ghost temporarily deployed to Metax_ci May 2, 2026 17:15 — with GitHub Actions Inactive
Copy link
Copy Markdown

@PaddlePaddle-bot PaddlePaddle-bot left a comment

Choose a reason for hiding this comment

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

🤖 Paddle-CI-Agent | pr_review | 2026-05-03 21:42:19

📋 Review 摘要

PR 概述:重构 tests/worker/test_worker_process.py,大幅扩展 worker_process 模块的单元测试覆盖面(从 278 行扩展至 419 行)。
变更范围tests/worker/
影响面 Tag[CI]


📝 PR 规范检查

标题中 [CI] 为官方合法 Tag,但末尾附有 [cf] 后缀,不属于官方 Tag 列表,建议删除。PR 描述仅为 placeholder,缺少所有必填 section(Motivation / Modifications / Usage or Command / Accuracy Tests / Checklist),需补充完整。

标题建议(可直接复制):

  • [CI] Add unit tests for worker_process module

PR 描述建议(可直接复制,必须复刻 checklist §D2 模板的完整结构):

## Motivation`fastdeploy/worker/worker_process.py` 补充全面的单元测试,提升该模块的测试覆盖率,满足 Hackathon 10th Spring No.36 任务要求。

## Modifications
- 重构 `tests/worker/test_worker_process.py`,从 278 行扩展至 419 行
- 新增 `_cfg()` / `_make()` / `_fd_env()` 辅助函数,减少重复 mock 代码
- 新增 `TestWorkerUtils` 类,覆盖 `intercept_paddle_loggers``parse_args``get_worker``update_fd_config_for_mm``init_distributed_environment``initialize_fd_config` 等工具函数
- 新增 `TestPaddleDisWorkerProc` 类,覆盖构造函数、健康检查、KV Cache 初始化、EPLB、控制方法、barrier/broadcast、kvcache lock、`run_worker_proc` 等核心流程

## Usage or Command
N/A

## Accuracy Tests
N/A

## Checklist

- [x] Add at least a tag in the PR title.
  - Tag list: [`[FDConfig]`,`[APIServer]`,`[Engine]`, `[Scheduler]`, `[PD Disaggregation]`, `[Executor]`, `[Graph Optimization]`, `[Speculative Decoding]`, `[RL]`, `[Models]`, `[Quantization]`, `[Loader]`, `[OP]`, `[KVCache]`, `[DataProcessor]`, `[BugFix]`, `[Docs]`, `[CI]`, `[Optimization]`, `[Feature]`, `[Benchmark]`, `[Others]`, `[XPU]`, `[HPU]`, `[GCU]`, `[DCU]`, `[Iluvatar]`, `[Metax]`]
  - You can add new tags based on the PR content, but the semantics must be clear.
- [ ] Format your code, run `pre-commit` before commit.
- [x] Add unit tests. Please write the reason in this PR if no unit tests.
- [ ] Provide accuracy results.
- [ ] If the current PR is submitting to the `release` branch, make sure the PR has been submitted to the `develop` branch, then cherry-pick it to the `release` branch with the `[Cherry-Pick]` PR tag.

问题

级别 文件 概述
📝 PR 规范 PR 描述为 placeholder,所有必填 section 缺失;标题末尾含非官方后缀 [cf]
🟡 建议 tests/worker/test_worker_process.py test_intercept_paddle_loggers_non_paddle_logger_unchanged 场景在重构后被删除,non-paddle 前缀 logger 的不受影响行为不再有专项验证
❓ 疑问 tests/worker/test_worker_process.py _cfg() 使用 types.SimpleNamespace 模拟 FDConfig,跳过了 FDConfig.__init__ 内部的字段校验逻辑,真实的参数约束可能在测试中被绕过

🟡 建议详情tests/worker/test_worker_process.py

原有 test_intercept_paddle_loggers_non_paddle_logger_unchanged 测试验证了当 context manager 激活时,非 paddle.* 前缀的 logger 的 handler 列表不会被修改。本次重构将四个独立用例合并为一个 test_intercept_paddle_loggers,删去了 non-paddle 场景,建议补回该断言:

# 在 test_intercept_paddle_loggers 末尾追加
other_lg = logging.getLogger("other.test.check")
other_lg.addHandler(logging.StreamHandler())
cnt = len(other_lg.handlers)
with intercept_paddle_loggers():
    self.assertEqual(len(logging.getLogger("other.test.check").handlers), cnt)
other_lg.handlers = []

总体评价

测试重构思路清晰,_cfg() / _make() / _fd_env() 辅助函数有效降低了样板代码,新增的测试场景(KV Cache 分支、EPLB、dispatch)覆盖面有显著提升。主要需修复 PR 描述占位符,并补回 non-paddle logger 隔离性的验证场景。

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants