Repository navigation
test(codex): 慢 thread/read 兜底标题用例放大预算,name/set 不再被 200ms RPC 超时掐断 - #2525
Merged
Merged
Conversation
setCodexAppThreadName 的 timeoutMs 同时是 preview 等待预算和之后每个 RPC 的超时 (#2454)。用例只让第一次 preview 读慢,需要的是「预算短于那次慢读、但远大于本 机 RPC 往返」;200ms 在繁忙的 CI runner 上掐断了普通的 thread/name/set。改为预算 2s、慢读 3s:被测关系不变,RPC 超时有十倍以上余量。 Co-Authored-By: Claude Opus 5.5 <[email protected]>
deepcoldy
requested review from
47seek,
LucasIcarus,
xiaoxueSunn and
xiongz-c
as code owners
October 29, 2026 15:12
Co-Authored-By: Claude Opus 5.5 <[email protected]>
deepcoldy
pushed a commit
to uestcwangci/botmux
that referenced
this pull request
Oct 29, 2026
…ity-recovery-2473-final 在作者最新 head 36930a4 上同步 master 至 0345cc5(其 merge base 651a7d3 之后的 4 个提交:deepcoldy#2526/deepcoldy#2513/deepcoldy#2523/deepcoldy#2525)。唯一冲突在 worker-argv-reaction-status 首轮 re-arm 用例的启动等待段:作者已在 deepcoldy#2513 合入前用信号驱动 fixture(paint-phase 文件按观测阶段推进,消除 固定 6s 墙钟,即复审建议的根治方向)重写了该用例,merge 已把 fake 定义取为信号驱动版,故等待段配套取作者版(等 projected-working 采样器 再写 startup 信号);deepcoldy#2513 配 setTimeout fake 的 fresh-empty 等待与 信号 fake 不兼容、不采用,其启动保证被作者版更强的等待覆盖。 codex-app-runner.integration 自动合并,PR 容量用例与 deepcoldy#2523/deepcoldy#2526 改动并存。Pi 用例双引擎 + 2 核 isolate 重载 3 次绿、全文件 16/16; codex 集成/容量/engine/deployment 共 210 项 vitest 绿。 Co-Authored-By: Claude Code <[email protected]>
|
🚀 Released in v3.56.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
修 #2454 中出事的那条用例;#2454 里建议的接口拆分是生产改动,本 PR 不包含,见下文「未处理」。
现象
PR #2523 head
d82fe074f首跑 run 40891465999 / bun-test:与 #2454 记录的第一次(run 40554189061)同形。
根因
setCodexAppThreadName的timeoutMs同时是 preview 等待预算和之后每个 RPC(thread/name/set、校验用的thread/read)的超时。这条用例只让第一次 preview 读慢 300ms(假服务器只延迟 name/set 之前的第一次读),用timeoutMs: 200让 preview 等待耗尽。但同一个 200ms 也成了 name/set 的 RPC 超时,繁忙 runner 上本机往返超过 200ms,用例就红在 name/set 上,而不是被测的兜底逻辑上。修法(纯测试,两条用例)
两条的被测关系「预算短于那次慢读」都不变,name/set 和校验读的 RPC 超时从约等于往返耗时变成远大于往返耗时,有十倍以上余量。代价是每条多跑约 2.5s。注释写明这个关系,以及
timeoutMs一参两用的背景。证据
确定性对照:在假 app-server 里临时把
thread/name/set的响应推迟 250ms,模拟被拖慢的本机往返(只在实验中改,未提交):thread/name/set timed out after 200ms);未处理(生产代码,单独说明)
同文件「issues no thread/read when the preview wait budget is below the poll floor」那条用例,必须传 40ms 的
timeoutMs(低于 50ms 轮询下限),它的 name/set 和校验读也就只有 40ms 的 RPC 超时。这比本 PR 修的这条更脆,但只改测试改不掉。根治是 #2454 建议的接口拆分:把等待预算与单次 RPC 超时分成两个入参,生产唯一调用方(src/worker.ts,传 10s)行为不变。这是生产代码的接口改动,按要求不混进本 PR,另行处理。验证
test-hygiene58 例全绿;bun test --timeout=180000(全新 HOME/TMPDIR)跑本文件 32 例全绿。test/codex-app-threads.test.ts,src/零改动。🤖 Generated with Claude Code