client-ci: main 基线红 —— dispatchWeakNetwork 的 outbox TTL 断言(expected 24000 to be 60000),引入提交 acac14a6 自身即失败
- Dominant language
- TypeScript
- Stars
- 2.7k
- Forks
- 395
- Avg merge
- 21h 48m
- Merged PRs (30d)
- 776
Description
## 现象
`main` 上 `client-ci` 的 `verify` 与 `Windows unit tests (1/2)` 同时红在一条断言:
```
FAIL src/main/device-link/__tests__/dispatchWeakNetwork.test.ts
> [3] outbox 保留时长按 channel 收窄
> 默认 channel = 60s;放宽表 channel ×2 封顶 120s
AssertionError: expected 24000 to be 60000 // Object.is equality
- 60000
+ 24000
❯ src/main/device-link/__tests__/dispatchWeakNetwork.test.ts:202:69
202| expect(__testing.outboxEntryMaxAgeMs('local-db:sessions:list')).to…
```
## 归属:引入该测试的提交自身就是红的
该测试文件由 **`acac14a6`**(*fix(device-link): 被控端弱网收尾——link-accept 重试 +
outbox 事件驱动 + 逐 channel TTL*,#1477)引入。
- 该提交自己的 client-ci run
[30795712501](https://github.com/makecindy/cindy/actions/runs/30795712501):**failure**,
失败断言与上面**逐字相同**;
- 也就是说它是**带红合入 main** 的,不是后续某个提交打破的。
## 影响面
因为是 `main` 的基线红,**所有**开着的 PR 只要 CI 把分支与 main 合并就会一起红,
且 `verify`(Linux)与 Windows 两个分片同时中招 —— 与平台无关,是确定性失败。
实测:PR #1421 触及 `device-link` **0 个文件**
(`git diff --name-only origin/main...HEAD | grep -c device-link` = 0),
但 `verify` 与 `Windows unit tests (1/2)` 都红在这一条。
## 排查方向(交该模块负责人)
断言期望 `local-db:sessions:list` 这个 channel 的 outbox 保留时长为 60s,实测 24s。
两种可能:
1. **实现与测试不同步**:逐 channel TTL 的表里 `local-db:sessions:list` 落在了某个
更短的档(24s),而测试按"默认 channel = 60s"写 —— 那么该 channel 是不是本就该走
放宽表、或默认档取值有变,需要作者确认哪一侧是对的;
2. **常量被别处覆盖**:`outboxEntryMaxAgeMs` 的默认值或倍率在合入时被相邻改动影响。
无论哪种,修复都应连同「为什么带红合入」一起看一眼 —— 合入前那次 run 的结论值得回溯。
## 出处
在 PR #1421 的 review follow-up 中撞上。该 PR 与 device-link 无关,不宜顺带改,
故单独开 issue。
> 同一 `Windows unit tests` 分片另有两条**互相独立**的既有问题:
> `VoiceInputSection` 源码正则断言(#1448)与 `packages/maker-core` SQLite 迁移
> 用例超时(#1416)。本条与它们不是同一个根因。
Contributor guide
Research direction
Start with src/main/device-link/__tests__/dispatchWeakNetwork.test.ts around line 202 and the outboxEntryMaxAgeMs entry point, then compare the test with the implementation introduced by commit acac14a6. Run the failing client-ci verify or Windows unit test to reproduce the 24000-versus-60000 assertion. Done means the intended channel TTL is confirmed with the module owner, the implementation and test agree, and both reported CI jobs pass.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- testing
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100