diff --git a/src/storage/shadow.ts b/src/storage/shadow.ts index fbd57e19de..749d6aa598 100644 --- a/src/storage/shadow.ts +++ b/src/storage/shadow.ts @@ -453,8 +453,11 @@ export class UnifiedShadow { close(): void { try { this.store.close(); - } catch { - // shutdown path — never throw + } catch (err) { + // shutdown path — never throw, but a swallowed close failure leaves + // the sqlite handle locked (windows EBUSY on temp-dir teardown); log + // it so the next CI red names the real culprit. + loggerLog("warn", `[storage] sidecar sqlite close failed — handle may stay locked: ${String(err)}`); } } } diff --git a/tests/persist-guard-ownership.test.ts b/tests/persist-guard-ownership.test.ts index 0443bad178..373363803a 100644 --- a/tests/persist-guard-ownership.test.ts +++ b/tests/persist-guard-ownership.test.ts @@ -42,11 +42,17 @@ function withMode(mode: "shadow" | "legacy", name: string, fn: (dir: string) => const dir = mkdtempSync(join(tmpdir(), `bili-guard-own-${mode}-`)); try { await fn(dir); - } finally { - rmrf(dir); + } catch (err) { + // A teardown EBUSY must never mask the real failure (windows win22-1 + // #3498: the rmrf ladder's EBUSY replaced the actual error). + try { rmrf(dir); } catch { /* keep the original error */ } if (prev === undefined) delete process.env.BILI_STORAGE_UNIFIED; else process.env.BILI_STORAGE_UNIFIED = prev; + throw err; } + rmrf(dir); + if (prev === undefined) delete process.env.BILI_STORAGE_UNIFIED; + else process.env.BILI_STORAGE_UNIFIED = prev; }) as unknown as Promise; } diff --git a/tests/pi-omp-fork-adopt.test.ts b/tests/pi-omp-fork-adopt.test.ts index 872f85cfde..4e2d9ec753 100644 --- a/tests/pi-omp-fork-adopt.test.ts +++ b/tests/pi-omp-fork-adopt.test.ts @@ -319,7 +319,7 @@ async function harness() { await once(proxy, "listening"); const paddr = proxy.address(); assert(paddr && typeof paddr === "object"); - return { dir, store, upstreamUrl, origin: `http://127.0.0.1:${paddr.port}`, close: async () => { store.cancelAll(); proxy.close(); proxy.closeIdleConnections?.(); upstream.close(); upstream.closeIdleConnections?.(); await Promise.all([once(proxy, "close"), once(upstream, "close")]); } }; + return { dir, store, upstreamUrl, origin: `http://127.0.0.1:${paddr.port}`, close: async () => { store.cancelAll(); proxy.close(); proxy.closeIdleConnections?.(); proxy.closeAllConnections?.(); upstream.close(); upstream.closeIdleConnections?.(); upstream.closeAllConnections?.(); await Promise.all([once(proxy, "close"), once(upstream, "close")]); } }; } async function seedParent(h: Awaited>, conversationId: string) { @@ -366,7 +366,7 @@ function pluginCtx(h: Awaited>, sid: string, parentSe }; } -test("full chain: omp lane adopts behind its own identity register (#2399 stage 2 / B-plan)", async () => { +test("full chain: omp lane adopts behind its own identity register (#2399 stage 2 / B-plan)", { timeout: 60_000 }, async () => { resetForkCapabilityCacheForTest(); const h = await harness(); try { @@ -406,7 +406,7 @@ test("full chain: omp lane adopts behind its own identity register (#2399 stage } }); -test("full chain: pi lane resolves a path-shaped parentSession header and adopts (#2399 stage 2)", async () => { +test("full chain: pi lane resolves a path-shaped parentSession header and adopts (#2399 stage 2)", { timeout: 60_000 }, async () => { resetForkCapabilityCacheForTest(); const h = await harness(); try { @@ -436,7 +436,7 @@ test("full chain: pi lane resolves a path-shaped parentSession header and adopts } }); -test("full chain: pi lane skips adoption when no parent is declared", async () => { +test("full chain: pi lane skips adoption when no parent is declared", { timeout: 60_000 }, async () => { resetForkCapabilityCacheForTest(); const h = await harness(); try { @@ -453,7 +453,7 @@ test("full chain: pi lane skips adoption when no parent is declared", async () = } }); -test("pi lane: lineage-only child is skipped before any snapshot/fork call (#2469)", async () => { +test("pi lane: lineage-only child is skipped before any snapshot/fork call (#2469)", { timeout: 60_000 }, async () => { resetForkCapabilityCacheForTest(); const h = await harness(); try { @@ -496,7 +496,7 @@ test("pi lane: lineage-only child is skipped before any snapshot/fork call (#246 } }); -test("pi lane: seeded child at the branch-length boundary still adopts (#2469)", async () => { +test("pi lane: seeded child at the branch-length boundary still adopts (#2469)", { timeout: 60_000 }, async () => { resetForkCapabilityCacheForTest(); const h = await harness(); try { @@ -534,7 +534,7 @@ test("pi lane: seeded child at the branch-length boundary still adopts (#2469)", } }); -test("pi lane: an exploding getBranch fails toward capability and still adopts (#2469)", async () => { +test("pi lane: an exploding getBranch fails toward capability and still adopts (#2469)", { timeout: 60_000 }, async () => { resetForkCapabilityCacheForTest(); const h = await harness(); try { @@ -565,14 +565,14 @@ test("pi lane: an exploding getBranch fails toward capability and still adopts ( } }); -test("tryForkAdoption rejects a responses child whose prefix matches nothing (#2469 stage 2)", async () => { +test("tryForkAdoption rejects a responses child whose prefix matches nothing (#2469 stage 2)", { timeout: 60_000 }, async () => { const { fetchImpl, calls } = fakeFetchRouting([snapshotRoute]); const result = await tryForkAdoption({ base: "http://px", parentConversationId: "p1", childConversationId: "c1", body: { model: "gpt", input: [{ type: "message", role: "user", content: "completely unrelated" }] }, fetchImpl }); assert.deepEqual(result, { outcome: "degraded", reason: "no prefix match" }); assert.equal(calls.filter((c) => c.url.endsWith("/__bili/plugin/fork")).length, 0, "no fork receipt is posted for a mismatch"); }); -test("full chain: responses-wire child adopts an openai-seeded parent (#2469 stage 2)", async () => { +test("full chain: responses-wire child adopts an openai-seeded parent (#2469 stage 2)", { timeout: 60_000 }, async () => { resetForkCapabilityCacheForTest(); const h = await harness(); try { @@ -623,7 +623,7 @@ test("full chain: responses-wire child adopts an openai-seeded parent (#2469 sta // session_start must yield only for the SAME parent declaration. // --------------------------------------------------------------------------- -test("fork endpoint: identity-registered child yields only for the same parent (#2399 B-plan)", async () => { +test("fork endpoint: identity-registered child yields only for the same parent (#2399 B-plan)", { timeout: 60_000 }, async () => { resetForkCapabilityCacheForTest(); const h = await harness(); try { diff --git a/tests/plugin-bypass.test.ts b/tests/plugin-bypass.test.ts index 0f39bc888d..00d4680661 100644 --- a/tests/plugin-bypass.test.ts +++ b/tests/plugin-bypass.test.ts @@ -71,8 +71,10 @@ mitm: { enabled: false, domains: [] }, close: async () => { proxy.close(); proxy.closeIdleConnections?.(); + proxy.closeAllConnections?.(); upstream.close(); upstream.closeIdleConnections?.(); + upstream.closeAllConnections?.(); await Promise.allSettled([once(proxy, "close"), once(upstream, "close")]); }, }; @@ -89,7 +91,7 @@ afterEach(async () => { }); describe("plugin bypass header (#920)", () => { - it("bypassed requests are forwarded verbatim — no tool injection, no nudge", async () => { + it("bypassed requests are forwarded verbatim — no tool injection, no nudge", { timeout: 60_000 }, async () => { const body = { model: "test-model", stream: false, messages: [{ role: "user", content: "hello legacy session" }] }; const resp = await fetch(`http://127.0.0.1:${h!.proxyPort}/bili/http://127.0.0.1:${h!.upstreamPort}/v1/chat/completions`, { method: "POST", @@ -104,7 +106,7 @@ describe("plugin bypass header (#920)", () => { assert.equal(h!.captured[0]!.headers["x-bili-plugin-bypass"], "1"); }); - it("without the header the same request gets the plugin pipeline (tools injected)", async () => { + it("without the header the same request gets the plugin pipeline (tools injected)", { timeout: 60_000 }, async () => { const body = { model: "test-model", stream: false, messages: [{ role: "user", content: "hello new session" }] }; const resp = await fetch(`http://127.0.0.1:${h!.proxyPort}/bili/http://127.0.0.1:${h!.upstreamPort}/v1/chat/completions`, { method: "POST", diff --git a/tests/plugin-fork.test.ts b/tests/plugin-fork.test.ts index 852ae4ef66..fc6ff7314d 100644 --- a/tests/plugin-fork.test.ts +++ b/tests/plugin-fork.test.ts @@ -112,10 +112,10 @@ async function harness(persist = false, seedParent = true, compressExtra: Record assert.equal(r.status, 200); await r.text(); } - return { request, messages, forwarded, dir, store, upstreamUrl, origin, close: async () => { store.cancelAll(); proxy.close(); upstream.close(); proxy.closeIdleConnections?.(); upstream.closeIdleConnections?.(); await Promise.all([once(proxy, "close"), once(upstream, "close")]); } }; + return { request, messages, forwarded, dir, store, upstreamUrl, origin, close: async () => { store.cancelAll(); proxy.close(); upstream.close(); proxy.closeIdleConnections?.(); proxy.closeAllConnections?.(); upstream.closeIdleConnections?.(); upstream.closeAllConnections?.(); await Promise.all([once(proxy, "close"), once(upstream, "close")]); } }; } -test("plain proxy panel snapshots do not change raw-history persistence", async () => { +test("plain proxy panel snapshots do not change raw-history persistence", { timeout: 60_000 }, async () => { const h = await harness(); try { const session = getSession("plain-panel"); @@ -126,7 +126,7 @@ test("plain proxy panel snapshots do not change raw-history persistence", async } finally { await h.close(); } }); -test("HTTP exposes a versioned snapshot and forks an exact ordered prefix", async () => { +test("HTTP exposes a versioned snapshot and forks an exact ordered prefix", { timeout: 60_000 }, async () => { const h = await harness(); try { const manifest = await h.request("/__bili/plugin/manifest"); @@ -159,7 +159,7 @@ async function sendIntentModel(h: Awaited>, conversat assert.equal(response.status, 200, await response.text()); } -test("HTTP explicit main with only public ACP tools captures initial history, usage and first fork payload", async () => { +test("HTTP explicit main with only public ACP tools captures initial history, usage and first fork payload", { timeout: 60_000 }, async () => { const h = await harness(false, false); try { const tools = (await h.request("/__bili/plugin/manifest")).body.tools.openai; @@ -192,7 +192,7 @@ test("HTTP explicit main with only public ACP tools captures initial history, us } finally { await h.close(); } }); -test("HTTP explicit main without tools survives a tiny output budget", async () => { +test("HTTP explicit main without tools survives a tiny output budget", { timeout: 60_000 }, async () => { const h = await harness(false, false); try { await sendIntentModel(h, "parent", h.messages, [], "main", 100); @@ -203,7 +203,7 @@ test("HTTP explicit main without tools survives a tiny output budget", async () } finally { await h.close(); } }); -test("HTTP title on the same plugin lane cannot replace the main snapshot or usage", async () => { +test("HTTP title on the same plugin lane cannot replace the main snapshot or usage", { timeout: 60_000 }, async () => { const h = await harness(); try { const snapshot = (await h.request("/__bili/plugin/snapshot?conversationId=parent")).body; @@ -222,7 +222,7 @@ test("HTTP title on the same plugin lane cannot replace the main snapshot or usa } finally { await h.close(); } }); -test("HTTP missing or unknown intent keeps all-bili demotion; anonymous main cannot claim plugin intent", async () => { +test("HTTP missing or unknown intent keeps all-bili demotion; anonymous main cannot claim plugin intent", { timeout: 60_000 }, async () => { const h = await harness(false, false); try { const tools = (await h.request("/__bili/plugin/manifest")).body.tools.openai; @@ -246,7 +246,7 @@ function forkRequest(snapshot: { parentRevision: string; orderedMessages: unknow return { protocolVersion: 1, parentConversationId: "parent", childConversationId: child, parentRevision: snapshot.parentRevision, branchPoint: { messageCount: count, orderHash: hash(orderedMessages) }, orderedMessages, idempotencyKey: `fork-${child}` }; } -test("HTTP protected tools keep plain-text snapshots, forks and revisions usable (#2620)", async () => { +test("HTTP protected tools keep plain-text snapshots, forks and revisions usable (#2620)", { timeout: 60_000 }, async () => { const h = await harness(false, false, { protectedTools: ["ask_user_question"] }); try { const history = [ @@ -281,7 +281,7 @@ test("HTTP protected tools keep plain-text snapshots, forks and revisions usable } finally { await h.close(); } }); -test("HTTP dsh-lane durable guards keep plain-text snapshots, forks and revisions usable (#2676)", async () => { +test("HTTP dsh-lane durable guards keep plain-text snapshots, forks and revisions usable (#2676)", { timeout: 60_000 }, async () => { const h = await harness(false, false); try { const history = [ @@ -313,7 +313,7 @@ test("HTTP dsh-lane durable guards keep plain-text snapshots, forks and revision } finally { await h.close(); } }); -test("HTTP snapshot still rejects a genuinely inconsistent raw/ref mapping (#2620)", async () => { +test("HTTP snapshot still rejects a genuinely inconsistent raw/ref mapping (#2620)", { timeout: 60_000 }, async () => { const h = await harness(); try { const session = resolveConversation("parent").session!; @@ -327,7 +327,7 @@ test("HTTP snapshot still rejects a genuinely inconsistent raw/ref mapping (#262 } finally { await h.close(); } }); -test("HTTP tool witnesses never override explicit parent, child or sibling identities", async () => { +test("HTTP tool witnesses never override explicit parent, child or sibling identities", { timeout: 60_000 }, async () => { const h = await harness(); try { const snapshot = (await h.request("/__bili/plugin/snapshot?conversationId=parent")).body; @@ -360,7 +360,7 @@ test("HTTP tool witnesses never override explicit parent, child or sibling ident } finally { await h.close(); } }); -test("HTTP native callers honor fork identity and revision despite a sibling witness", async () => { +test("HTTP native callers honor fork identity and revision despite a sibling witness", { timeout: 60_000 }, async () => { const h = await harness(); try { const parent = (await h.request("/__bili/plugin/snapshot?conversationId=parent")).body; @@ -387,7 +387,7 @@ test("HTTP native callers honor fork identity and revision despite a sibling wit } finally { await h.close(); } }); -test("HTTP snapshot normalizes tool error flags and rejects a success identity for a failed result", async () => { +test("HTTP snapshot normalizes tool error flags and rejects a success identity for a failed result", { timeout: 60_000 }, async () => { const h = await harness(); try { const history = (isError?: boolean) => [ @@ -417,7 +417,7 @@ test("HTTP snapshot normalizes tool error flags and rejects a success identity f } finally { await h.close(); } }); -test("HTTP fork fails closed on malformed, missing, stale and reordered boundaries", async () => { +test("HTTP fork fails closed on malformed, missing, stale and reordered boundaries", { timeout: 60_000 }, async () => { const h = await harness(); try { const snapshot = (await h.request("/__bili/plugin/snapshot?conversationId=parent")).body; @@ -437,7 +437,7 @@ test("HTTP fork fails closed on malformed, missing, stale and reordered boundari } finally { await h.close(); } }); -test("HTTP concurrent identical forks publish once and conflicting parents cannot overwrite", async () => { +test("HTTP concurrent identical forks publish once and conflicting parents cannot overwrite", { timeout: 60_000 }, async () => { const h = await harness(); try { const snapshot = (await h.request("/__bili/plugin/snapshot?conversationId=parent")).body; @@ -462,7 +462,7 @@ async function compress(h: Awaited>, conversationId = return r; } -test("HTTP compressed originals are isolated across parent and siblings and straddlers are excluded", async () => { +test("HTTP compressed originals are isolated across parent and siblings and straddlers are excluded", { timeout: 60_000 }, async () => { const h = await harness(); try { await compress(h); @@ -502,7 +502,7 @@ test("HTTP compressed originals are isolated across parent and siblings and stra } finally { await h.close(); } }); -test("HTTP exact fork materializes its inherited summary with equivalent SDK text and bili-only tools", async () => { +test("HTTP exact fork materializes its inherited summary with equivalent SDK text and bili-only tools", { timeout: 60_000 }, async () => { const h = await harness(); try { await compress(h); @@ -527,7 +527,7 @@ test("HTTP exact fork materializes its inherited summary with equivalent SDK tex } finally { await h.close(); } }); -test("HTTP first fork request rejects a mismatched inherited prefix without forwarding or mutating state", async () => { +test("HTTP first fork request rejects a mismatched inherited prefix without forwarding or mutating state", { timeout: 60_000 }, async () => { const h = await harness(); try { await compress(h); @@ -553,7 +553,7 @@ test("HTTP first fork request rejects a mismatched inherited prefix without forw } finally { await h.close(); } }); -test("HTTP persistence failure leaves no child and retry can succeed", async () => { +test("HTTP persistence failure leaves no child and retry can succeed", { timeout: 60_000 }, async () => { const h = await harness(); try { const snapshot = (await h.request("/__bili/plugin/snapshot?conversationId=parent")).body; @@ -572,7 +572,7 @@ test("HTTP persistence failure leaves no child and retry can succeed", async () } finally { _setStoreForTest(h.store); await h.close(); } }); -test("HTTP CCR deleted index fails closed in memory after persistence", async () => { +test("HTTP CCR deleted index fails closed in memory after persistence", { timeout: 60_000 }, async () => { const h = await harness(true); try { const parent = resolveConversation("parent").session!; @@ -595,7 +595,7 @@ test("HTTP CCR deleted index fails closed in memory after persistence", async () } finally { await h.close(); } }); -test("HTTP CCR shared payload deletion fails closed before persistence", async () => { +test("HTTP CCR shared payload deletion fails closed before persistence", { timeout: 60_000 }, async () => { const h = await harness(); try { const parent = resolveConversation("parent").session!; @@ -665,7 +665,7 @@ for (const corruption of ["missing-ref", "missing-payload", "orphan-payload", "w }); } -test("HTTP fork revision and originals survive a new proxy process", async () => { +test("HTTP fork revision and originals survive a new proxy process", { timeout: 60_000 }, async () => { const h = await harness(true); let child: ReturnType | undefined; try { @@ -727,7 +727,7 @@ test("HTTP fork revision and originals survive a new proxy process", async () => } }); -test("HTTP status separates real usage from a manual-compression estimate and changing generation", async () => { +test("HTTP status separates real usage from a manual-compression estimate and changing generation", { timeout: 60_000 }, async () => { const h = await harness(); try { const before = await h.request("/__bili/plugin/status?conversationId=parent"); @@ -764,7 +764,7 @@ test("HTTP status separates real usage from a manual-compression estimate and ch } finally { await h.close(); } }); -test("HTTP manual compression renews an idle context observation without changing billing", async () => { +test("HTTP manual compression renews an idle context observation without changing billing", { timeout: 60_000 }, async () => { const h = await harness(); const realNow = Date.now; try { @@ -789,7 +789,7 @@ test("HTTP manual compression renews an idle context observation without changin } }); -test("HTTP compressed child effective estimate survives cold disk restore without replaying credit", async () => { +test("HTTP compressed child effective estimate survives cold disk restore without replaying credit", { timeout: 60_000 }, async () => { const h = await harness(true); try { const snapshot = (await h.request("/__bili/plugin/snapshot?conversationId=parent")).body; @@ -818,7 +818,7 @@ test("HTTP compressed child effective estimate survives cold disk restore withou } finally { await h.close(); } }); -test("HTTP manual compress rejects a stale expectedRevision under the session lock", async () => { +test("HTTP manual compress rejects a stale expectedRevision under the session lock", { timeout: 60_000 }, async () => { const h = await harness(); try { const snapshot = (await h.request("/__bili/plugin/snapshot?conversationId=parent")).body; @@ -830,7 +830,7 @@ test("HTTP manual compress rejects a stale expectedRevision under the session lo } finally { await h.close(); } }); -test("HTTP missing nested originals and CCR payloads fail closed without publishing a child", async () => { +test("HTTP missing nested originals and CCR payloads fail closed without publishing a child", { timeout: 60_000 }, async () => { const h = await harness(); try { await compress(h); @@ -856,7 +856,7 @@ async function sendModel(h: Awaited>, conversationId: assert.equal(response.status, 200, await response.text()); } -test("HTTP multimodal snapshots are explicitly unavailable, not text-only matches", async () => { +test("HTTP multimodal snapshots are explicitly unavailable, not text-only matches", { timeout: 60_000 }, async () => { const h = await harness(); try { const before = (await h.request("/__bili/plugin/snapshot?conversationId=parent")).body; @@ -872,7 +872,7 @@ test("HTTP multimodal snapshots are explicitly unavailable, not text-only matche } finally { await h.close(); } }); -test("HTTP CCR foreign placeholder ref cannot publish an exact empty-store child", async () => { +test("HTTP CCR foreign placeholder ref cannot publish an exact empty-store child", { timeout: 60_000 }, async () => { const h = await harness(true); try { const baseline = (await h.request("/__bili/plugin/snapshot?conversationId=parent")).body; @@ -921,7 +921,7 @@ for (const content of [null, "audio transcript"] as const) { }); } -test("HTTP fork before absorb summary preserves the original pair on the first child request", async () => { +test("HTTP fork before absorb summary preserves the original pair on the first child request", { timeout: 60_000 }, async () => { const h = await harness(); try { const toolOutput = "unique original build output ".repeat(250); @@ -982,7 +982,7 @@ test("HTTP fork before absorb summary preserves the original pair on the first c } finally { await h.close(); } }); -test("HTTP different parents racing the same child publish exactly one identity", async () => { +test("HTTP different parents racing the same child publish exactly one identity", { timeout: 60_000 }, async () => { const h = await harness(); try { await sendModel(h, "other-parent", h.messages); @@ -997,7 +997,7 @@ test("HTTP different parents racing the same child publish exactly one identity" } finally { await h.close(); } }); -test("HTTP fork registration and first model append preserve inherited state and refs", async () => { +test("HTTP fork registration and first model append preserve inherited state and refs", { timeout: 60_000 }, async () => { const h = await harness(); try { await compress(h); @@ -1017,7 +1017,7 @@ test("HTTP fork registration and first model append preserve inherited state and } finally { await h.close(); } }); -test("HTTP nested summaries expand crossing ancestors and retain independent original caches", async () => { +test("HTTP nested summaries expand crossing ancestors and retain independent original caches", { timeout: 60_000 }, async () => { const h = await harness(true); try { const history = [...h.messages, { role: "assistant", content: "third response ".repeat(250) }, { role: "user", content: "fourth user turn ".repeat(250) }, { role: "assistant", content: "retained recent tail" }]; @@ -1082,7 +1082,7 @@ test("HTTP nested summaries expand crossing ancestors and retain independent ori } finally { await h.close(); } }); -test("HTTP raw-snapshot retention cap fails closed instead of growing without bound (D-B)", async () => { +test("HTTP raw-snapshot retention cap fails closed instead of growing without bound (D-B)", { timeout: 60_000 }, async () => { // #2016 review: without a cap every plugin session retains its full raw // history forever. With BILI_PUBLIC_SNAPSHOT_CAP_BYTES set tiny, the // session refuses to retain the snapshot and the public endpoints answer @@ -1107,7 +1107,7 @@ test("HTTP raw-snapshot retention cap fails closed instead of growing without bo } }); -test("HTTP raw-snapshot retention cap lifts when the raw history shrinks below it again", async () => { +test("HTTP raw-snapshot retention cap lifts when the raw history shrinks below it again", { timeout: 60_000 }, async () => { const previous = process.env.BILI_PUBLIC_SNAPSHOT_CAP_BYTES; process.env.BILI_PUBLIC_SNAPSHOT_CAP_BYTES = "1"; const h = await harness(); @@ -1141,7 +1141,7 @@ function stableJson(value: unknown): string { return JSON.stringify(value) ?? "null"; } -test("HTTP CoW snapshot extends in place with an exactly-tracked byte count", async () => { +test("HTTP CoW snapshot extends in place with an exactly-tracked byte count", { timeout: 60_000 }, async () => { const h = await harness(); try { const session = resolveConversation("parent").session!; @@ -1162,7 +1162,7 @@ test("HTTP CoW snapshot extends in place with an exactly-tracked byte count", as } finally { await h.close(); } }); -test("HTTP legacy snapshots are remeasured once, then no-op resends stay O(1) while the cap keeps re-evaluating", async () => { +test("HTTP legacy snapshots are remeasured once, then no-op resends stay O(1) while the cap keeps re-evaluating", { timeout: 60_000 }, async () => { const h = await harness(); try { const session = getSession("legacy-cap"); @@ -1191,7 +1191,7 @@ test("HTTP legacy snapshots are remeasured once, then no-op resends stay O(1) wh } finally { await h.close(); } }); -test("HTTP the raw snapshot persists only once a fork makes it an external contract", async () => { +test("HTTP the raw snapshot persists only once a fork makes it an external contract", { timeout: 60_000 }, async () => { const h = await harness(true); try { const parent = resolveConversation("parent").session!; @@ -1208,7 +1208,7 @@ test("HTTP the raw snapshot persists only once a fork makes it an external contr } finally { await h.close(); } }); -test("HTTP a mid-history rewrite replaces the snapshot wholesale with an exact byte count", async () => { +test("HTTP a mid-history rewrite replaces the snapshot wholesale with an exact byte count", { timeout: 60_000 }, async () => { const h = await harness(); try { const session = resolveConversation("parent").session!; @@ -1223,7 +1223,7 @@ test("HTTP a mid-history rewrite replaces the snapshot wholesale with an exact b } finally { await h.close(); } }); -test("HTTP a lazily-persisted snapshot self-heals on the next model request after restart", async () => { +test("HTTP a lazily-persisted snapshot self-heals on the next model request after restart", { timeout: 60_000 }, async () => { const h = await harness(true); try { const parent = resolveConversation("parent").session!; @@ -1240,7 +1240,7 @@ test("HTTP a lazily-persisted snapshot self-heals on the next model request afte } finally { await h.close(); } }); -test("fork protocol v2: snapshot serves the light revision, a stale v1 whole-store revision is still accepted (#2671 Phase 2b)", async () => { +test("fork protocol v2: snapshot serves the light revision, a stale v1 whole-store revision is still accepted (#2671 Phase 2b)", { timeout: 60_000 }, async () => { const h = await harness(); try { const snapshot = await h.request("/__bili/plugin/snapshot?conversationId=parent"); @@ -1261,7 +1261,7 @@ test("fork protocol v2: snapshot serves the light revision, a stale v1 whole-sto } finally { await h.close(); } }); -test("fork protocol v2: revision is stable across state churn that does not move the snapshot or active blocks (#2671 Phase 2b)", async () => { +test("fork protocol v2: revision is stable across state churn that does not move the snapshot or active blocks (#2671 Phase 2b)", { timeout: 60_000 }, async () => { const h = await harness(); try { const before = await h.request("/__bili/plugin/snapshot?conversationId=parent");