The bridge's app-liveness tests decide on real time and fail intermittently
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 72/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- node.js, react-native, typescript
- 领域
- testing
调研方向
Start with packages/bridge/src/__tests__/app-liveness.test.ts and trace how its real-time failedWithin(ms) races the liveness monitor against sleep(ms). Check how the monitor receives its clock and whether the test can control it while keeping the real bridge and WebSocket setup. Done when the liveness cases decide from the configured budgets and the intermittent timing failures are addressed.
由索引模型根据 Issue 内容生成。
描述
Describe the bug
packages/bridge/src/__tests__/app-liveness.test.ts runs the liveness monitor on real timers with budgets tens of milliseconds apart (an idle budget of 150 ms, a file-load budget of 300 ms) and decides each case by racing the monitor's verdict against a real timer: failedWithin(ms) is Promise.race([outcome, sleep(ms)]). When the event loop runs late, a timer meant to land between two budgets lands past one of them, and a case fails although the monitor behaved as specified. On main the file fails about one run in thirty, in different cases:
FAIL src/__tests__/app-liveness.test.ts > app liveness > gives loading a test file the file-load budget
AssertionError: expected false to be true // Object.is equality
FAIL src/__tests__/app-liveness.test.ts > app liveness > fails a blocked JS thread after the idle budget, naming the phase
AssertionError: expected false to be true // Object.is equality
so it can fail any PR's test job. The file pairs a real bridge and client over a real WebSocket, so a clock the test controls, handed to the monitor, would let each case decide on the budgets alone.
System Info
System:
OS: Linux 6.18 Ubuntu 24.04.5 LTS (WSL 2)
CPU: 32 cores
Binaries:
Node: 23.11.1
pnpm: 10.6.1
React Native Harness Version
1.6.0 (main at 81ed195)
Reproduction
Steps to reproduce
pnpm install, then build the packages:pnpm nx run-many -t build.- In
packages/bridge, run the file thirty times:for i in $(seq 30); do npx vitest run src/__tests__/app-liveness.test.ts; done. One of my thirty runs failed, in the first case above; with every core of the machine kept busy, one of ten failed, in the second.
- 主要语言
- TypeScript
- 星标
- 335
- 派生
- 23
- 平均合并
- 1 天 8 小时
- 30 天内合并 PR
- 54
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
callstackincubator/react-native-harness 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 82/100
callstackincubator/react-native-harness#296 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
callstackincubator/react-native-harness#128 ·
维护者通常 1 天内回复
-
难度 3/5 1-2 天 新手友好度 52/100
callstackincubator/react-native-harness#300 ·
维护者通常 1 天内回复
-
难度 3/5 1-2 天 新手友好度 72/100
callstackincubator/react-native-harness#299 ·
维护者通常 1 天内回复
-
难度 3/5 1-2 天 新手友好度 72/100
callstackincubator/react-native-harness#273 ·
维护者通常 1 天内回复
查看 callstackincubator/react-native-harness 的全部 Issue
相似的 Issue
-
[Bug]: Pen taps on sidebar rows start a drag and lose their click可能已有人在做 @makhnatkin 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复
-
enhancement
难度 2/5 1-3 小时 新手友好度 70/100
b310-digital/teammapper#1515 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 79/100
puckeditor/puck#1884 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 65/100
outline/outline#14378 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
nicobailon/pi-web-access#642 ·
维护者通常 1 天内回复