Skip to content

[Drive-by] #7346 regression test simulates the fix's effect but does not exercise the prepare-openai fix line #7373

Open

Description

@ranxianglei

🤖 Powered by ework · qwen3.8-27b

found-in: PR #7357 (the #7346 fix — "watermark-HIT window save must not retire the verified prefix")

symptom/trigger: tests/issue7346-pf-window-ledger.test.ts pins the #3285 sweep/no-sweep contract by calling shadow.record directly with the two rawTail shapes (undefined for the fix, the window for the pre-fix). It simulates the fix's downstream effect (rawTail=undefined => no sweep) but does not exercise the prepare-openai.ts fix line (if (wpHit !== undefined) session.lastMessagesFolded = true), so it would not fail if that line were removed. The prepare -> persist link (HIT turn => lastMessagesFolded=true => persist.ts:3081 omits the raw tail) is untested.

proposed fix: add a full-path test that drives a watermark-HIT turn through prepareOpenai -> persist -> shadow and asserts the verified prefix is preserved (fails if the fix line is removed). Non-trivial (needs a HIT-turn request simulation), so not a drive-by fix.

blocking: none — straightforward once the HIT-turn simulation is set up. Low priority: the fix is 1 line and the storage contract is pinned; the gap only matters if the fix line is removed, which code review would catch.


Mirrored from ework issue #7374

Activity

  1. ranxianglei commented on Nov 20, 2026

    @ranxianglei
    OwnerAuthor

    🤖 Powered by ework · qwen3.8-27b

    [bot] 🏷 (ai: vllm-qwen/qwen3.8-27b)

    查重: 不重复. Open [PR]/issue rows touching this surface: only #7358 (the PR #7357 fix itself) and this #7374. No other issue/PR pins the prepare→persist→shadow full-path gap.

    标签: bug dsh p3 scope/ci — test-coverage defect in the dsh watermark-lane regression; p3 because the 1-line fix and the storage contract are already pinned, the gap only bites if the fix line is deleted.

    Confirmed the gap is real: tests/issue7346-pf-window-ledger.test.ts calls shadow.record directly with the two rawTail shapes — it never drives prepareOpenai, so deleting if (wpHit !== undefined) session.lastMessagesFolded = true (prepare-openai.ts:675) would leave the suite green.

    Plan: add a full-path test on the PR #7357 branch (2026-11-20_issue7346-pf-window-ledger) that drives a real watermark-HIT turn through the proxy (shadow mode) and asserts the verified prefix survives in the ledger — fails if the fix line is removed. Working on it now.

  2. ranxianglei commented on Nov 20, 2026

    @ranxianglei
    OwnerAuthor

    🤖 Powered by ework · qwen3.8-27b

    [bot] 🏷 (ai: vllm-qwen/qwen3.8-27b)

    Done. Added a full-path regression test to PR #7357's branch (2026-11-20_issue7346-pf-window-ledger), commit 7a4224ed.

    What it does: tests/issue7346-pf-window-ledger-fullpath.test.ts drives a real watermark-HIT turn through the full proxy in shadow mode (sidecar → full resend → HIT) and asserts the verified prefix survives in the ledger after the HIT turn.

    Verified:

    • Passes with the fix line present (6 live rows: the full log).
    • Fails when the fix line is removed (2 live rows: the swept window) — AssertionError: the verified prefix must survive the HIT window save (got 2 live rows).
    • Typecheck clean. Existing sibling test (issue7346-pf-window-ledger.test.ts) still passes.

    PR #7357 head is now 7a4224ed (2 commits: the fix + this test).


    八问:

    1. 是什么问题: tests/issue7346-pf-window-ledger.test.ts 直接调 shadow.record 钉住 [bug] Fold anchor detaches after host restart (parent-gone): hydrated and unified-shadow DIGEST DRIFT within the same second, gap solidifies without self-healing (0.1.197, complementary to #3013 restart path) | [bug] 宿主重启(parent-gone)后 fold 锚点脱锚:hydrated 与 unified-shadow DIGEST DRIFT 同秒,缺口固化不自愈(0.1.197,与 #3013 重启路径互补) #3285 sweep/no-sweep 契约,但从不驱动 prepareOpenai——删掉修复行 if (wpHit !== undefined) session.lastMessagesFolded = true 后测试套件仍绿。
    2. 什么原因导致的: 现有测试模拟了修复的下游效果(rawTail=undefined ⇒ 不 sweep),但没有覆盖 prepare→persist 链路(HIT 轮 ⇒ lastMessagesFolded=true ⇒ persist.ts:3081 省略 raw tail),所以修复行被删时测试抓不住。
    3. 影响范围与严重程度: 仅在修复行被删时才有影响,代码审查可发现。低优先级:修复只有 1 行,存储契约已钉住。
    4. 怎么修复的: 加了一个全路径测试,通过完整代理(shadow 模式)驱动一个真实的水位 HIT 轮(sidecar → 全量重发 → HIT),断言 HIT 轮后验证前缀在账本中存活。
    5. 是否有回归问题: 无。测试是纯新增(新文件),不改任何既有行为。
    6. 是否破坏缓存: 无。测试用 hermetic tempdir,不碰任何缓存。
    7. 是否改了设计方向: 无。测试是回归测试,不改设计方向。
    8. 是否引入了新的配置: 无。测试用现有 env var(BILI_ROLLOUT_PLUGIN_FULL_RESEND_WATERMARK、BILI_STORAGE_UNIFIED)。

    判定: 可合 — 测试钉住了修复行,PR #7357 现在覆盖了 prepare→persist→shadow 全链路。

  3. ranxianglei commented on Nov 20, 2026

    @ranxianglei
    OwnerAuthor

    🤖 Powered by ework · qwen3.8-27b

    [bot] 🏷 (ai: vllm-qwen/qwen3.8-27b)

    CI fix: the Windows EBUSY failure on the new test is resolved. CI is now green (30/30, 0 failed) on head 74c6ece6.

    What happened: the first push (7a4224ed) failed on test (windows-latest, 22, 5) with EBUSY: resource busy or locked, unlink '…index.db' in the test teardown. Root cause: the test runs in shadow mode with the SessionStore enabled: true, so its shadow UnifiedStore opens index.db and holds a file lock; on Windows a locked file cannot be unlinked, so the rmSync in the finally block threw EBUSY. (Linux passes because rmSync unlinks open files.) Not inherited — the fix-only head and master were both green on that shard.

    Fix (two commits on the PR branch):

    Why the hardening matters: the first fix put closeQuietly after closeServers inside the try block, so it only ran when the test passed. When the assertion fails (the fix line removed — the whole point of this regression test), the throw skips closeQuietly, the shadow still holds the lock, and the rmSync in finally throws EBUSY, masking the real assertion error. Moving it to finally means the assertion error now propagates cleanly on every platform, and rmBestEffort tolerates any residual lock race.

    Verified:

    • Test passes locally (1/1); sibling test still passes (2/2); typecheck clean.
    • CI on 74c6ece6: 30/30 green, including test (windows-latest, 22, 5).

    PR #7357 head is now 74c6ece6 (the #7346 fix + the full-path test + 2 teardown commits). The 八问 in the previous comment still applies — the test is unchanged, only its teardown was hardened.

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions