test(api): personal-realtime-asr-gateway「aborts a finishing provider」单 tick 竞态,高负载下随机红
- Dominant language
- TypeScript
- Stars
- 0
- Forks
- 0
- Avg merge
- 1h 7m
- Merged PRs (30d)
- 969
Description
## 背景
rev-uiux 重评 track V-D/V-P 时,`verify:base` 的唯一失败是
`apps/api/tests/recording/personal-realtime-asr-gateway.test.ts:185`
「aborts a finishing provider when the browser disconnects」——AssertionError:
expected false to be true。全量套件内 1 failed / 5921 passed;隔离外壳单独
跑该文件 7/7 通过。判定为既有 flaky 用例,非本轮改动引入的回归。
## 根因
该用例在 `client.ws.close()` 后只等一个 `setTimeout(…, 0)` 宏任务 tick 就
断言服务端 `aborted` 为 true——高负载下这个假设不成立(服务端处理 close
事件的实际耗时会超过一个 tick)。
## 影响
它会持续污染 `verify:base`/H3 硬门,让每一轮 UI 保真评分都需要人工判定
「这是真红还是抖动」,而不是机械可判定的绿/红。
## 修法
改用 `vi.waitFor(() => expect(aborted).toBe(true))` 或等服务端可观测信号
(如一个 abort 事件/回调),而不是等固定 tick。
(rev-uiux 登记,非本人自评;本 issue 由 coord-main 落档)
Contributor guide
No contributing guide indexed for this repository
Research direction
Open apps/api/tests/recording/personal-realtime-asr-gateway.test.ts at line 185 and inspect the test for aborting a finishing provider after client.ws.close(). Run the isolated test and verify:base to reproduce or confirm the timing-sensitive assertion. Done means the test waits for the server-side aborted signal rather than one fixed tick and remains reliable under load.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- backend, testing
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 88/100