From 6388f08e78d60718ffc2072790d1ee34fc45f336 Mon Sep 17 00:00:00 2001 From: ci-check Date: Sun, 25 Oct 2026 14:39:11 +0800 Subject: [PATCH] test: make plugin-fork refLedgerAlignment expectation mode-aware (#4599 sentinel follow-up) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The unconditional 'refLedgerAligned = true' expectation assumed a unified-mode cold load. On runners without the node:sqlite engine the store resolves to legacy-only (liveStorageStamp), the one-time ledger restamp never runs, and the flag is absent from the loaded state — born-red on every windows leg since #4316 PR3/3 landed (master run 40167778049, w22s3/w22s4 legs). Key the expectation on SessionStore.liveStorageStamp (#3135/#3818 honest per-instance mode stamp): flag expected only when full mode actually holds the data. Verified both directions locally: default env (full -> flag expected, pass) and BILI_STORAGE_UNIFIED=legacy (legacy stamp -> flag not expected, pass). --- tests/plugin-fork.test.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/plugin-fork.test.ts b/tests/plugin-fork.test.ts index d15bc89fe9..65d1146a55 100644 --- a/tests/plugin-fork.test.ts +++ b/tests/plugin-fork.test.ts @@ -752,10 +752,12 @@ test("HTTP fork revision and originals survive a new proxy process", { timeout: parent.contentStore = storeOriginal(createContentStore(), { ref: "m00001", rawId: parent.pluginSnapshot![0].id, text: "CCR original retained independently after restart", kind: "original", tokens: 10, head: "CCR original" }); parent.contentStoreDirty = true; assert(h.store.flushSync(parent)); - // #4316 PR3/3: cold load runs the one-time ledger alignment — the loaded - // state now carries refLedgerAligned. Mirror it in the expectation. + // #4316 PR3/3: a unified-mode cold load runs the one-time ledger alignment — + // the loaded state then carries refLedgerAligned. Mirror the LIVE mode stamp + // (#3135/#3818): runners without the node:sqlite engine stay legacy-only and + // never restamp, so the flag is expected only when full mode holds the data. const persistedState = JSON.parse(JSON.stringify(parent.state)); - persistedState.refLedgerAligned = true; + if (h.store.liveStorageStamp === "full") persistedState.refLedgerAligned = true; assert.deepEqual(JSON.parse(JSON.stringify(h.store.loadSync("parent")!.state)), persistedState); const snapshot = (await h.request("/__bili/plugin/snapshot?conversationId=parent")).body; const req = forkRequest(snapshot);