Repository navigation
fix(ci): ci-net-retry 识别 apt 的 429/5xx 镜像限流并重试 - #3630
Conversation
|
你好,这个 PR 的自动评审群已建,麻烦点击链接加入群聊、查看评审意见并跟进后续修改: 另外你暂时不在自动拉群名单里,也可以把 GitHub 账号和飞书信息补进名单文档,补好后后续评审会自动拉你进群:https://bytedance.larkoffice.com/wiki/WJ1nwWbtxi89erkNGNbcgkt9nUe (本条为自动流程发出的提示消息) |
新增 TRANSIENT 规则里 408、500、503(两种原因短语)、504 分支此前 没有专属用例:实测摘掉这些分支测试仍全绿(变异存活)。补 5 条 apt 日志形态夹具,每个状态码与短语分支的变异现在都会咬红。 Co-Authored-By: Claude Fable 5 <[email protected]>
deepcoldy
left a comment
There was a problem hiding this comment.
结论:针对 f0102f84d,代码与测试层面可合,未发现新的合前阻断项。 新 head 的 CI 在发表本意见时仍在运行,合并仍以最终 checks 为准。
1. 补充夹具足够,变异验证通过
test/ci-net-retry.test.ts:26-32 现在覆盖 apt 的 408、429、500、502、503(两种短语)与 504;runWithRetry 的恢复/持续失败两条路径也已有 429 用例。
我在独立临时源码副本中复验,而不是仅阅读夹具:
- 基线 Vitest:76/76 通过;当前 worktree 另跑 Bun:76/76 通过。
- 11 组单点变异(逐个移除状态码、原因短语,以及切换 503 长/短短语)全部咬红。
- 将
scripts/ci-net-retry.mjs:54整条新 apt 规则置为不命中后,恰好 9 failed / 67 passed:7 条分类用例加 2 条 429 重试用例。
因此 f0102f84d 已补齐此前存活的正则分支,不再只是给实现拍照。
2. 认可 flake 归因与 #3643
- 原 run
44562559664的bun-test (3/4)日志确认为test/v3-progress-card-manager.test.ts:198期望 1 次、实际 0 次;该分片 608 个文件中只有这个文件失败。 - 该测试文件相对本 PR 基线逐字未变;当前 head 下 Vitest 与 Bun 各跑一次均为 13/13 通过。
test/v3-progress-card-manager.test.ts:191只等待真实setTimeout(10),而首次 refresh 在调用reply前还要经过src/im/lark/v3-progress-card-manager.ts:223的文件锁、sidecar/envelope/journal 读取与写入,直到:300-302才进入 transport。runner 过载时断言先于首次reply执行,得到 0 次;这不是合流逻辑产生重复调用的失败形状。
#3643 的根因描述成立,改成等待 fake reply 首次进入的 promise 后再断言,也比继续调大 wall-clock 更合适。
非阻断备注
scripts/ci-net-retry.mjs:54的状态码+短语匹配没有限定 apt 行或 apt 命令。行为探针确认:普通编译错误若打印源码throw new Error("500 Internal Server Error"),也会被判为 transient 并有界重试。最终结果与退出码不变,只增加最多 150 秒等待,因此不作为本 PR 阻断项;后续若要收紧,可锚定 apt 的Err:/Failed to fetch行。test/ci-net-retry.test.ts:12的注释统称样本为真实输出,但:27-32是占位 IP 的合成夹具;下次触碰时可把「现场日志」与「合成边界样本」分开描述。
|
补充 CI 首跑结果: |
|
感谢贡献,已合并。 本 PR 让 后续跟踪(均不阻断本 PR):
以上为自动评审流程的落地记录,最终以维护者审阅为准,欢迎继续贡献。 |
|
@zerone0x @deepcoldy 合入 master 后的 Midscene E2E 失败:Feishu live Midscene 失败。 这次运行覆盖 189f370…411e9d032(8 个提交),同批合入的还有 #3610 #3642 #3632 #3635 #3633 #3629 #3567,失败不一定由本 PR 引起。
|
|
🚀 Released in v3.59.23 |
Summary
Fixes #3573.
scripts/ci-net-retry.mjsdid not recognise apt's429 Too Many Requestsoutput, sonetwork-boundaryfailed immediately on a mirror rate limit instead of retrying.Root cause
TRANSIENTonly matched npm/bun/curl shapes (GET <url> - 429,code E429,Response code 429). apt printsErr:N <url>/429 Too Many Requests [IP: ...]andE: Failed to fetch ... 429 Too Many Requests, which neither list matched, so it was classifiedunknownand not retried.Changes
scripts/ci-net-retry.mjs: add one TRANSIENT rule for apt status lines (408 Request Time-out,429 Too Many Requests,502/503/504/500with their reason phrases).DETERMINISTICis still checked first, so 401/403/404 and signature errors still fail fast.test/ci-net-retry.test.ts: fixtures for the apt 429 log (shape from the ci-net-retry 不识别 apt 的 429 输出,network-boundary 遇镜像限流不自动重试 #3573 job) and a 502; a bounded-retry test (recovers / exhausts 5 attempts); a test that 429 together with 404 stays deterministic.Repro
Before: the new apt 429 / 502 fixtures classify as
unknown(4 new tests fail with the script reverted). After: they classify astransientandrunWithRetryretries up to 5 times.Safety
Deterministic patterns take precedence, so the new rule cannot retry a not-found/forbidden/signature failure. Covered by the added 429+404 test and the existing apt deterministic cases.
Tests run
vitest run test/ci-net-retry.test.ts: 71 passed, 0 failed. Reverting the script change makes 4 of them fail. The runner was a minimal copy (the two files plus the workflow files the test reads), because the machine's disk was full and a fullbun installwas not possible. Full CI is the full-suite check.Behaviour changes and questions for maintainers
apt
update/installnow retries on 408/429/500/502/503/504 responses (bounded: 5 attempts, up to 150s of waiting). The fixture is reconstructed from the issue's log excerpt; the IP in it is illustrative.