fix(durable): keep pi.live cached in the partial-commit cost test

The suite's evicting run (PI_DURABLE_DOCUMENT_RETENTION_MS=0) evicts the unwatched pi.live after every
commit, so each partial commit replayed the document's delta chain and the per-commit cost grew with the
stream. Pin the document retention in that test so it measures appends, as the default retention does.
This commit is contained in:
Mario Zechner 2026-10-24 08:35:20 +00:00
parent da412b0392
commit 1e42501bb3

View file

@ -690,6 +690,9 @@ describe("streamed partials", () => {
const stream = async (size: number) => {
const setup = chatSetup({ tokensPerSecond: 64_000, tokenSize: { min: 64, max: 64 } });
setup.settings.progress = { partialIntervalMs: 1, outputIntervalMs: 100 };
// Keep `pi.live` cached between commits, as the default retention does. Evicted after each use (the suite's
// evicting run), every commit replays the document's delta chain: a cost of eviction, not of appending.
setup.settings.documentRetentionMs = 60_000;
const text = 'streamed text with "quotes" and \\ escapes\n'.repeat(size / 40);
setup.faux.setResponses([
fauxAssistantMessage(