Skip to content

Commit c4fd097

Browse files
committed
test(session): drop unrelated cache tests from the crash fence
1 parent c0d7a35 commit c4fd097

2 files changed

Lines changed: 1 addition & 62 deletions

File tree

‎src/session/optimized-context-store.test.ts‎

Lines changed: 0 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -2268,64 +2268,3 @@ describe("createOptimizedContextStore metadata ownership (CL-10667)", () => {
22682268
expect((await resumed.load()).tokenUsage).toEqual(USAGE_TWO);
22692269
});
22702270
});
2271-
2272-
describe("live-turns generation cache staleness (CL-10757)", () => {
2273-
test("in-process append invalidates the cache: load serves fresh turns", async () => {
2274-
const dir = tempDir();
2275-
const store = await createOptimizedContextStore(dir);
2276-
// The reactor extends its live turns array in place, so the store detects
2277-
// the append by reference: keep the first turn object stable.
2278-
const first = turn("one");
2279-
await store.writeTurns([first]);
2280-
// Populates the generation cache.
2281-
expect(turnTexts((await store.load()).turns)).toEqual(["one"]);
2282-
2283-
await store.writeTurns([first, turn("two")]);
2284-
expect(turnTexts((await store.load()).turns)).toEqual(["one", "two"]);
2285-
});
2286-
2287-
test("a committed rewrite is never served stale from the cache", async () => {
2288-
const dir = tempDir();
2289-
const store = await createOptimizedContextStore(dir);
2290-
await store.writeTurns([turn("keep-a"), turn("drop-me")]);
2291-
await store.writeMetadata(EMPTY_CHECKPOINT_METADATA);
2292-
await store.commit({ message: "published original" });
2293-
// Populates the generation cache.
2294-
expect(turnTexts((await store.load()).turns)).toEqual([
2295-
"keep-a",
2296-
"drop-me",
2297-
]);
2298-
2299-
// A rewrite stages off the live generation until commit, then the commit
2300-
// lands it on disk: the post-commit load must serve it, not the cache.
2301-
await store.writeTurns([turn("[Compacted prior context]"), turn("keep-b")]);
2302-
await store.commit({ message: "publish compact" });
2303-
expect(turnTexts((await store.load()).turns)).toEqual([
2304-
"[Compacted prior context]",
2305-
"keep-b",
2306-
]);
2307-
});
2308-
2309-
test("a foreign write between loads is never served stale from the cache", async () => {
2310-
const dir = tempDir();
2311-
const first = await createOptimizedContextStore(dir);
2312-
await first.writeTurns([turn("one")]);
2313-
// Populates the first generation's cache.
2314-
expect(turnTexts((await first.load()).turns)).toEqual(["one"]);
2315-
2316-
// A second live generation on the same dir (longer body so the segment
2317-
// stat changes even at coarse mtime granularity).
2318-
const second = await createOptimizedContextStore(dir);
2319-
await second.writeTurns([turn("one"), turn("two-with-a-longer-body")]);
2320-
expect(turnTexts((await second.load()).turns)).toEqual([
2321-
"one",
2322-
"two-with-a-longer-body",
2323-
]);
2324-
2325-
// The first generation's cached parse must not shadow the foreign write.
2326-
expect(turnTexts((await first.load()).turns)).toEqual([
2327-
"one",
2328-
"two-with-a-longer-body",
2329-
]);
2330-
});
2331-
});

‎src/session/state.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ export async function finalizeRunState(
209209
// enforced here, not left to caller discipline: both production callers
210210
// (process-handlers.ts handleFatal and the signal handlers) flip it via
211211
// markCrashed() before finalizing, and any other caller fails closed instead
212-
// of landing a terminal record queued snapshot writes may then clobber.
212+
// of landing a terminal record that queued snapshot writes may then clobber.
213213
//
214214
// Second terminal path, separate on purpose: only index.ts's process-level
215215
// uncaughtException/unhandledRejection and signal handlers reach it (a crash

0 commit comments

Comments
 (0)