Repository navigation
test(tmux): 死 pane 退出状态等待按读计数给预算,消除饥饿下墙钟耗尽 flake - #3083
Merged
Merged
Conversation
CI 全量 shard 在高负载下偶发失败: expect(['0:','1:8']) 实得 ['0:','1:']。tmux 先把 pane 标记为 pane_dead=1,之后才回填 pane_dead_status;shard 饥饿时这个 '1:' 瞬态持续超过测试自设的 3s 墙钟预算,循环在状态回填前耗尽。 改为与同文件 waitForDeadPane 一致的读计数预算 (DEAD_PANE_MAX_READS / DEAD_PANE_POLL_INTERVAL_MS):被调度走的 测试进程不产生读取,饥饿只拉长墙钟、不烧穿读取预算。 Co-Authored-By: Claude Code <[email protected]>
deepcoldy
requested review from
47seek,
LucasIcarus,
xiaoxueSunn and
xiongz-c
as code owners
November 7, 2026 16:39
Owner
Author
|
已 squash 合入 master(7830c04ac1)。 合入前该 head 的 15 项检查全部 success(含必需的 build、test,以及 bun-test、四个 test 分片、CodeQL、bun-binary 三平台等),无失败检查。 落地核验:合入 commit 7830c04 的父提交为合入前 master 89bd88e;落地树 6d74e11c1 与 本 PR 已完成,无需再推送或重复合入。 |
deepcoldy
pushed a commit
that referenced
this pull request
Nov 8, 2026
This was referenced Nov 8, 2026
|
🚀 Released in v3.59.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.
背景
全量 shard 高负载下偶发(#3000 首跑 shard 2 实测):
```
test/tmux-pipe-exit-code.test.ts:556
AssertionError: one live and one retained dead pane:
expected [ '0:', '1:8' ]
received [ '0:', '1:' ]
```
`pane_dead` 翻到 1 与 `pane_dead_status` 回填不是同一个原子动作:tmux server 先标记 pane 死亡,reap 掉 pane 进程后才写入退出状态。原测试用 3 秒墙钟预算等 `1:8` 出现;shard 饥饿时 server 长时间得不到调度,`1:` 瞬态持续超过 3 秒,循环在状态回填前耗尽。同文件的 `waitForDeadPane` 注释(#2457/#2459)已记录过同一类 `1:` 瞬态,并明确「按读次数而非墙钟给预算:被调度走的测试进程不产生读取,饥饿只会拉长等待而不是判失败」。
改动
单文件 `test/tmux-pipe-exit-code.test.ts`,+6/-3,无 src 改动:把该用例的 3s 墙钟循环换成与 `waitForDeadPane` 相同的读计数预算(复用模块级常量 `DEAD_PANE_MAX_READS=240` / `DEAD_PANE_POLL_INTERVAL_MS=25`),断言与其余行为不变。
验证
--timeout=180000跑;裸bun test <文件>用默认 5s 超时,本文件基线即 48 pass / 8 fail,补丁后同形态 49/7,红项均为默认超时、与本补丁无关);改动文件 tsc(ES2023 lib)0 错。影响面
只改测试等待方式,不碰生产代码与断言口径;`remain-on-exit` 尸体保留、「不全死不 reap」的行为钉住不变。不发版、不部署。
🤖 Generated with Claude Code