Skip to content

The master CI advisory test is guaranteed to fail: #3619 added an extra policy fetch to the forced-update path, but the | master CI advisory 测试必挂:#3619 给强制更新路径多了一个策略 fetch,旧断言没跟上(3!==2) #3970

Closed

Description

@ranxianglei

来源: #3896 (PR #3894 review) 分析 CI 红时发现

现象

tests/advisory.test.ts:627「checkForUpdate: a forced manual update bypasses the first-check deferral」失败:
assert.equal(calls, 2, ...) → AssertionError: 3 !== 2(tests/advisory.test.ts:643)。

复现:

机制(fetch 探针已钉死)

强制更新路径实际 fetch 顺序:

  1. registry packument(/billion-context/latest)
  2. raw.githubusercontent.com/…/auto-update-policy.json ← Automatic staggered rollout: default random upgrade interval of 15 min – 48 h + GitHub remote policy file (emergency kil | 自动升级撒点:默认 15 分钟~48 小时随机升级 + GitHub 远程策略文件(紧急刹车/按版本调速),给事故留响应窗 #3619 的 passUpdatePolicyGate(src/update.ts:1445)无条件拉远程策略——force=true 也只跳过 hold/stagger,不跳过策略 fetch(代码注释明确:manual updates still resolve pinned/blocked);
  3. tarball。

该测试写于 #2456 时期(早于 #3619,2026-10-18 合入),断言停在 calls === 2;#3619 多了一个 fetch,断言没跟上 → 计数必然差一。策略 fetch 被测试 mock 以 "unexpected fetch" 拒绝后 loadUpdatePolicy 按设计 fail-open 落到本地默认值,自更新运行时行为不受影响,纯测试断言滞后。

影响

建议修法(倾向 A,B 需 owner 拍板)

A. 仅测试:给 withFetch 注册 auto-update-policy.json 路由(返回空 doc),断言改为 calls === 3(packument + policy + tarball),与 #3619 文档化行为对齐;若验证发现 counts 受 memo 影响,则加 test seam 重置 memo 或断言区间。不动 src/update.ts。
B. 行为级:force=true 路径整体跳过策略 fetch(手动更新本就不需要 pacing/policy)——改变自更新语义,属 owner 决策。

[no-dispatch] 建议作为独立小修走一个 PR(master 侧),不要混进 #3894。

Activity

  1. changed the title [-]master CI advisory 测试必挂:#3619 给强制更新路径多了一个策略 fetch,旧断言没跟上(3!==2)[/-] [+]The master CI advisory test is guaranteed to fail: #3619 added an extra policy fetch to the forced-update path, but the | master CI advisory 测试必挂:#3619 给强制更新路径多了一个策略 fetch,旧断言没跟上(3!==2)[/+] on Oct 20, 2026
  2. ranxianglei commented on Oct 20, 2026

    @ranxianglei
    OwnerAuthor

    Fixed by #3969 (merged): the forced-update advisory case now mocks the #3619 policy fetch (auto-update-policy.json → empty all-defaults doc) and expects policy + packument + tarball = 3 calls. Master advisory 27/27 green post-merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions