Skip to content

test(hook): 流取消用例的截止改用冷启动预算,不再与 CLI import 抢 6 秒 - #2622

Merged
deepcoldy merged 1 commit into
masterfrom
test/native-hook-stream-cancel-budget
Oct 30, 2026
Merged

deepcoldy merged 1 commit into
masterfrom
test/native-hook-stream-cancel-budget

Conversation

@deepcoldy

Copy link
Copy Markdown
Owner

Fixes #2621

改了什么

test/native-subagent-runtime-hook.test.ts ›「cancels oversized and timed-out never-ending response streams」去掉两处 exitTimeoutMs: 6_000,改用 runHook 的默认冷启动预算(20s),it 超时相应改为 50s(两次 runHook 各 20s + 余量),失败时报错带上 hook 的 stderr。只改测试。

为什么这样改仍然咬得住行为:测试服务器的两种响应流都永远不结束。hook 若没在自己的 2s 截止内中止流,会一直挂到 20s 被测试杀掉,timedOut 为真照样红;放宽的只是「CLI 冷启动 + 2s」这段正常耗时,不是 hook 的取消行为。

不改生产代码:hook 的 2s 响应截止在 import 完、发请求时才开始计,本来就和冷启动无关。

验证

  • 确定性对照(isolate-run 限 2 核 + 4 个空转,同一用例各 6 次):旧写法 3/6 失败(报错与 CI 一致 expected true to be false),新写法 6/6 通过。
  • 变异:把 hook 的 controller.abort() 去掉(不再中止响应流)→ 本用例在 21.5s 红。
  • test/native-subagent-runtime-hook.test.ts + test/test-hygiene.test.ts 45/45 通过。

影响面

纯测试,不碰 src。挡在 #2618 上(G4:偶发不重跑放行),本 PR 合入后 #2618 同步 master 再跑。

🤖 Generated with Claude Code

@deepcoldy
deepcoldy merged commit 3b1a171 into master Oct 30, 2026
15 checks passed
@deepcoldy

Copy link
Copy Markdown
Owner Author

合码回执:已合入 master 3b1a171b2(最终 head 24ef15390),#2621 已随之关闭。被它挡住的 #2618 已同步 master 到 c53a31cfb,等新 head 首跑。

@github-actions

Copy link
Copy Markdown

@deepcoldy 合入 master 后的 Midscene E2E 失败:Feishu live Midscene 失败。

这次运行覆盖 54b28df…887309883(7 个提交),同批合入的还有 #2543 #2582 #2620 #2607 #2618 #2625,失败不一定由本 PR 引起。

用例 跑道 状态 失败信息
Gemini basic bot flow feishu-core-clis failed waitFor timeout: Based on the screenshot, the main content area displays a conversation titled "申晗和Gemini的会话". I am looking for a specific text bubble from Gemini containing "ACK-e2e-gemini-179338841…

@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown

🚀 Released in v3.56.0

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.

test: native-subagent-runtime-hook 流取消用例的 6s 截止含 CLI 冷启动,CI 高负载下偶发超时

1 participant