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; } } 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");