Skip to content

test: platform-scaled hot-reload waitFor ceiling (darwin 60s, others 15s) - #4

Merged
bytesnail merged 1 commit into
mainfrom
test/hot-reload-waitfor-headroom
Oct 4, 2026
Merged

bytesnail merged 1 commit into
mainfrom
test/hot-reload-waitfor-headroom

Conversation

@bytesnail

Copy link
Copy Markdown
Owner

Why

2026-10-04 的 CI 高峰期里,热加载测试在 ~30 分钟内超时 4 次,全部在 darwin 上:FSEvents 的送达延迟没有 SLA,负载中的共享 runner 上超过了 15s 上限(失败样本 duration_ms=15039,真实尾部未知)。

What

  • waitFor 默认上限按平台区分:darwin 60s,其他平台维持 15s(Linux inotify / Windows ReadDirectoryChangesW 从未接近过 15s)
  • 60s 与 e2e harness poll() 已在生产使用的上限对齐,有实证依据
  • 超时错误现在带上平台和实际等待时长——下次再抖会留下数据而不是猜测

为什么不是根治

抬上限是在买尾部余量(5→15→60 的追尾巴没有尽头)。真正确定性的方案是测试断言改轮询式 watch,但那需要改动插件的选项面,不值得为一个 CI flake 做。如果 60s 之后还出现 darwin 超时,再开 issue 讨论结构性方案。

Cost analysis

健康运行时成本为零:50ms 轮询在条件满足时立即返回,上限只在 watcher 真正卡死时才会被全额消耗(那种情况本来就该失败)。

…15s)

2026-10-04's CI storm produced 4 hot-reload timeouts in ~30 minutes, all
on darwin: FSEvents delivery latency has no SLA and exceeded the 15s
ceiling on loaded shared runners. Raising the ceiling is free on healthy
runs — the 50ms poll returns as soon as the condition holds; the ceiling
only burns when the watcher is genuinely stuck. 60s on darwin matches the
ceiling test/e2e/run.mjs's poll() already uses successfully. Timeout
errors now report the platform and the actual wait, so the next flake
brings data instead of a guess.
@bytesnail
bytesnail merged commit 59194ba into main Oct 4, 2026
15 checks passed
@bytesnail
bytesnail deleted the test/hot-reload-waitfor-headroom branch October 4, 2026 19:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant