From 5f406b12e3703e1116a767732264adda905d87b9 Mon Sep 17 00:00:00 2001 From: ranxianglei Date: Fri, 13 Nov 2026 23:34:47 +0800 Subject: [PATCH 1/2] test(#5219): pin the JSON writer on so the decode-cap gate is host-hermetic withUnified set BILI_STORAGE_UNIFIED=full but not the writer: a host config file with storage.jsonWriter=off (the pure-sqlite default since #6480, where the file value always wins over the 'full' dual-write default) silently leaves the disk empty, every boot decodes nothing, and the warm-set/small-corpus gates read 0. CI is clean-host so it never saw this; the env pin makes the gate independent of the host's storage knobs, matching what the test actually measures. --- tests/issue5219-bounded-boot-decode-cap.test.ts | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/tests/issue5219-bounded-boot-decode-cap.test.ts b/tests/issue5219-bounded-boot-decode-cap.test.ts index 2fdf7976b5..288f28d881 100644 --- a/tests/issue5219-bounded-boot-decode-cap.test.ts +++ b/tests/issue5219-bounded-boot-decode-cap.test.ts @@ -38,12 +38,20 @@ async function fixture(run: (dir: string, store: SessionStore) => Promise) } async function withUnified(run: () => Promise): Promise { - const prev = process.env.BILI_STORAGE_UNIFIED; + const prevUnified = process.env.BILI_STORAGE_UNIFIED; + const prevWriter = process.env.BILI_STORAGE_JSON_WRITER; process.env.BILI_STORAGE_UNIFIED = "full"; + // The gate counts JSON-envelope decodes, which requires dual-write. A host + // config file with storage.jsonWriter=off (the pure-sqlite default since + // #6480 flips the "absent" tier off, and the file value always wins) would + // silently leave the disk empty and every count 0 — pin the writer on. + process.env.BILI_STORAGE_JSON_WRITER = "1"; try { await run(); } finally { - if (prev === undefined) delete process.env.BILI_STORAGE_UNIFIED; - else process.env.BILI_STORAGE_UNIFIED = prev; + if (prevUnified === undefined) delete process.env.BILI_STORAGE_UNIFIED; + else process.env.BILI_STORAGE_UNIFIED = prevUnified; + if (prevWriter === undefined) delete process.env.BILI_STORAGE_JSON_WRITER; + else process.env.BILI_STORAGE_JSON_WRITER = prevWriter; } } From c6369fb6a195fbd1e8794c911adaff87d4dba0f0 Mon Sep 17 00:00:00 2001 From: ework-agent Date: Sat, 14 Nov 2026 04:35:44 +0800 Subject: [PATCH 2/2] fix(tests): pin pure-sqlite selection in notice-registry suite MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The suite baseline preload (preload-storage-baseline.mjs) pins BILI_STORAGE_UNIFIED="legacy" for the broad corpus. After #6480 flipped the storage default to pure-sqlite, the notice-registry suite's visibleNotices assertions expect the pure-sqlite default notice, which is gated on unifiedSelectionIsSqlite (unified "sqlite" or absent) — the preload's "legacy" made the notice silent, so the suite was born-red on master. Pin the selection explicitly (#4011 lesson: a test that depends on the production default passes locally but fails in CI). --- tests/notice-registry.test.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/notice-registry.test.ts b/tests/notice-registry.test.ts index 6d3b60edb4..b3b0d0e8a4 100644 --- a/tests/notice-registry.test.ts +++ b/tests/notice-registry.test.ts @@ -17,6 +17,11 @@ const cfgPath = path.join(fs.mkdtempSync(path.join(os.tmpdir(), "notice-reg-cfg- process.env.DSH_HOME = fs.mkdtempSync(path.join(os.tmpdir(), "notice-reg-dsh-")); process.env.XDG_STATE_HOME = stateDir; process.env.BILI_CONFIG_FILE = cfgPath; +// #4011 lesson: this suite asserts the pure-sqlite default notice is visible, +// which requires the pure-sqlite SELECTION (unified "sqlite" or absent — the +// gate is unifiedSelectionIsSqlite, not the resolved mode). The suite baseline +// preload pins "legacy" for the broad corpus, so pin the selection explicitly. +process.env.BILI_STORAGE_UNIFIED = "sqlite"; const { NOTICES, visibleNotices, SQLITE_DEFAULT_NOTICE_ID } = await import("../src/notices.ts"); const { IOT_INCOMPAT_NOTICE_ID, PCK_NOTICE_ID, WM_FASTPATH_INTRO_ID, dismissUpgradeNotice } = await import("../src/pck-notice.ts");