Files
SupplierSystem/server/tests
Ubuntu 07503b2658
CI / server typecheck + tests (push) Canceled after 0s
CI / web typecheck + tests + miniprogram syntax (push) Canceled after 0s
CI / eslint (观察项,C7 骨架) (push) Canceled after 0s
CI / npm audit (critical 硬拦) (push) Canceled after 0s
test(改价改量): 拆掉随墙钟「由绿变红」的时间炸弹(幽灵 pending 30 分钟窗口)
现象:mainSystemPriceQtyRequest.test.ts 两个「旧 amend 轮询补齐」用例在 2026-10-11 10:30(CST) 之后必红
(本次会话早前的全量跑该文件还是绿的),断言 closed:1 实得 0、实测 checked:1 closed:0 failed:1。

根因(**不是产品缺陷,是固定日期 fixture**,已用日志与行号坐实):
  · ledgerRow 的 created_at 写死 '2026-10-11T02:00:00.000Z'(tests/…:101);
  · 同一提交 aa2db57 又给「无 request_id 的历史行」加了 STALE_PENDING_MS=30min 的**幽灵 pending 闸门**
    (mainSystemPriceQtyRequest.ts:1760,超窗即标 failed 请重提);
  · 作者写 fixture 时那个时刻是"未来 2 天",闸门永不触发;墙钟越过 02:30Z 那一刻起 fixture 落进窗外,
    两个用例走到的变成"幽灵 pending"分支(该分支只 UPDATE + failed,不打日志)⇒ 由绿转红。

修法(**只动测试,产品代码零改动**):新增 freshLegacyRowTimestamps(),两处 `request_id: null` 的 fixture
改用"当前时刻" —— 30 分钟窗口本就该路径唯一可达的区间,用例语义(补齐落地 / 只记录不覆盖)不变。

验证:
  · npx vitest run tests/mainSystemPriceQtyRequest.test.ts ⇒ 46/46 通过
  · 服务端全量 376 文件 / 2358 用例 ⇒ 失败 25 文件 = 基线 24 + 另一条工作线遗留的
    zeroCostClearsPlanPrice(1d9adce 的 StockInboundPanel 改写,非本次引入)
  · 全仓复查:`Date.now() - <窗口>` 类时间闸门只此一处
2026-10-11 12:46:06 +08:00
..