Skip to content

CI: Dogfood shards and rerun-safety-nightly still present a #4250-style stall as hang-until-timeout — roll out run-with-stall-guard #4314

Description

@os-zhuang

背景

#4309(closes 方向为 #4250 的止损)给 Test Core 加了 scripts/run-with-stall-guard.mjs:输出静默超过 --stall-minutes 即判定停摆 —— 打印判词(冻结时刻、最后一行输出、rerun 分诊指引)、杀掉测试进程组、exit 75(EX_TEMPFAIL)。同时由 guard 自己 tee 日志并透传真实退出码,退役了 … 2>&1 | tee + set -o pipefail 的掩红隐患。

但同样的停摆模式(#4250:输出冻结、job 挂 in_progress 直到兜底超时)在其余跑测试套件的 job 里仍是"挂到超时":

现状清单(截至 #4309 合并后的 main)

位置 现状 停摆的呈现
ci.yml → Dogfood 两个 shard 的 Boot example apps and exercise real user flows set -o pipefail + 2>&1 | tee "$RUNNER_TEMP/dogfood.log",job timeout 45 分钟 挂最多 45 分钟。Dogfood 起真实 example app + 真实 HTTP 栈,恰是 #4250 怀疑的"真实引擎/句柄"高危区
rerun-safety-nightly.yml → pass 1 与 pass 2(同一工作树跑两遍全量,dogfood 含在内) job timeout 120 分钟,无输出监测;pass 2 用 if ! pnpm turbo run test … 包着自定义 ::error 挂最多 120 分钟,且是 nightly,没人盯
(顺带评估)coverage-nightly.yml 的 spec 覆盖跑 无 tee,30 分钟 timeout,无停摆检测 挂最多 30 分钟

要做的事(纯搬运)

把上述测试步骤改为经 run-with-stall-guard.mjs 执行,阈值参考(健康时输出连续,阈值取最长静默间隔的 ~5 倍):

  • Dogfood shard:--stall-minutes 10,--log "$RUNNER_TEMP/dogfood.log" 路径不变 → 后续的 Test completeness guard 无需改动;
  • rerun-safety 两遍:--stall-minutes 10~15。pass 2 的 if ! 包装与 guard 兼容(停摆时 exit 75 同样进入 error 块),但注意该 error 文案断言"第二遍失败 = 状态泄漏" —— 停摆红会被它误导,建议区分 exit 75(停摆)与其它非零(真的 rerun-unsafe)两种文案;
  • coverage-nightly 视改动成本顺手处理或明确豁免(说明原因)。

验收

  • 跑测试套件的 workflow 中不再出现 … 2>&1 | tee + set -o pipefail 组合(ci.ymlNo compiled test files in any dist 的 pipefail 是 find 检查,不在此列);
  • 每个跑套件的 job:停摆阈值 ≪ job timeout,停摆以带判词的红呈现,而非 in_progress 挂到兜底。

相关

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions