Repository navigation
wire-exit 早提交时序断言改为相对不变量,消除 Windows CI 偶发误报(#3228) - #3233
Merged
ranxianglei merged 1 commit intoOct 15, 2026
Merged
Conversation
Replace the absolute 'tHeaderMs < SLOW_MS' (SLOW_MS=1500) wall-clock bound in the wire-exit early-commit tests with a relative invariant ('tHeaderMs < summaryDoneMs - t0', both timestamps on the same process clock). The absolute bound flakes under CI runner load whenever the event loop stalls >1500ms before the mock's summarization timer fires; the relative form is load-invariant and still catches a true regression (headers committed after summarization completes/fails). Mirrors the #3147-C fix already merged in preflight-hold.test.ts (#3152) and covers the residual instances in wire-exit-matrix.test.ts and wire-exit-gap-cells.test.ts surfaced by class scan.
Fixes #3228
Contributor
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.3729-pr.3233.8f82358This exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr3233.tgz
npm install -g packageInstall instructions are refreshed on each push. |
Contributor
📦 Merged Build PublishedThis merge to master was published as npm install -g billion-context@0.0.441-master.db046b2 # this exact build
npm install -g billion-context@master # always the newest merged build
|
This was referenced Oct 15, 2026
Merged
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.
问题
#3228:
tests/wire-exit-matrix.test.ts里「早提交」时序断言在 CI Windows runner 上偶发误报,挡合并。失败签名'headers committed before the slow summarization failed (1968ms)'@tests/wire-exit-matrix.test.ts:348,仅test (windows-latest, 24, 1)单格红、其余 7 格绿,本地 standalone 全绿——是 CI runner 负载抖动下的测试自身脆弱性,不是回归。根因
断言用的是绝对墙钟上界
assert.ok(r.tHeaderMs < SLOW_MS)(SLOW_MS=1500)。它假设「客户端收到 header 的时刻 < 1500ms」,但客户端计时与 mock 的setTimeout(..., 1500)都挂在同一个 Node 事件循环上;当 runner 负载把事件循环卡住 >1500ms(mock 定时器还没到点、header 却已先被提交),这个绝对上界就误判。真实缺陷(早提交失效 → header 拖到 summarization 完成之后才发出)本应被抓,但绝对上界把「先后顺序」错当成了「时长」。同类机制已在 #3147-C(PR #3152,已合入)把
preflight-hold.test.ts的同款断言改成相对不变量。本 PR 覆盖 class-scan 找到的残留实例。修法
镜像 #3152-C:mock 在慢速 summarization 调用真正完成/失败的那一刻记录
summaryDoneMs(同一进程时钟),断言从绝对上界改为相对顺序不变量:tHeaderAt与summaryDoneAt同进程同时钟:均匀的事件循环卡顿对两者等量拉伸、不改变先后顺序(300ms hold-grace 定时器永远先于 1500ms 定时器触发),因此负载无关;而真实的早提交失效会让 header 落在 summarization 完成之后,仍会被抓住——牙齿没丢。改动文件(仅两个测试文件,无 server/config/wire 变更):
tests/wire-exit-matrix.test.ts— 两处断言(slow-summary-fwd-429/slow-summary-429)tests/wire-exit-gap-cells.test.ts— gap 3 一处断言行为变更披露
仅测试断言语义变化:绝对墙钟上界
< 1500ms→ 相对顺序「早于 summarization 完成」。断言抓取的缺陷集合不变(仍抓早提交失效),只去掉负载相关的假阳性。无任何生产代码、配置、wire 协议改动。验证
npm run typecheck:干净查重
查重: 与已关闭的 #3147(子缺陷 C,PR #3152 已合)为同一机制家族,非纯重复——#3152-C 只改了当日触发文件 preflight-hold,未覆盖本 PR 的两个兄弟文件;#3228 是残留实例,作为 tracker 保留并在此一并修完。
Closes #3228