test(gateway): prebuild child-cache retention fixture

This commit is contained in:
Peter Steinberger
2026-09-03 14:17:26 -07:00
parent ebaed97289
commit 8211f9f3f7
5 changed files with 17 additions and 8 deletions
+4 -3
View File
@@ -237,9 +237,10 @@ rebind's session accessor and binding helper together. Both processes use the sa
runtime graph while retaining the durable-write race and process-exit assertions.
Other Worker-thread entries and arbitrary source CLI fixtures remain outside this declared set.
The session-title retention test declares its title-reader and session-utils roots
in this same generation. Each fresh heap-measurement child runs their JavaScript
without spending its execution deadline on TypeScript imports.
The session-title and child-link retention tests declare their title-reader,
session-utils, and listing roots in this same generation. Each fresh
heap-measurement child runs their JavaScript without spending its execution
deadline on TypeScript imports.
Preparation is lazy across both projects and shards. Config imports, listing
tests, and tiny tests that do not import these declarations do not load the
+2
View File
@@ -22,6 +22,8 @@ export const vitestWorkerDeclarationEntries = {
"cron/owner-hardening-runtime.test-support": "src/cron/owner-hardening-runtime.test-support.ts",
"gateway/server-methods/sessions-list-cache-retention-entrypoint.test-support":
"src/gateway/server-methods/sessions-list-cache-retention-entrypoint.test-support.ts",
"gateway/session-child-cache-retention-entrypoint.test-support":
"src/gateway/session-child-cache-retention-entrypoint.test-support.ts",
"gateway/session-title-retention.test-support":
"src/gateway/session-title-retention.test-support.ts",
"node-host/config-runtime.test-support": "src/node-host/config-runtime.test-support.ts",
@@ -5,6 +5,7 @@ import { cliCompactionBackendEntrypoints } from "../../src/agents/command/cli-co
import { cliRecoveryEntrypoints } from "../../src/cli/cli-entrypoint.test-support.ts";
import { cronOwnerHardeningEntrypoints } from "../../src/cron/owner-hardening-runtime.test-support.ts";
import { sessionListCacheRetentionEntrypoint } from "../../src/gateway/server-methods/sessions-list-cache-retention-entrypoint.test-support.ts";
import { sessionChildCacheRetentionEntrypoint } from "../../src/gateway/session-child-cache-retention-entrypoint.test-support.ts";
import { sessionTitleRetentionEntrypoints } from "../../src/gateway/session-title-retention.test-support.ts";
import { nodeHostConfigRuntimeEntrypoint } from "../../src/node-host/config-runtime.test-support.ts";
import { persistenceRuntimeEntrypoint } from "../../src/skills/library/persistence-runtime.test-support.ts";
@@ -25,6 +26,7 @@ export const vitestWorkerBuildEntries = {
...Object.values(tuiPtyRuntimeEntrypoints),
...Object.values(sessionTitleRetentionEntrypoints),
sessionListCacheRetentionEntrypoint,
sessionChildCacheRetentionEntrypoint,
nodeHostConfigRuntimeEntrypoint,
channelIngressGatewayRestartEntrypoint,
persistenceRuntimeEntrypoint,
@@ -0,0 +1,6 @@
// Prepare the listing graph before the retention child's bounded GC checks.
export const sessionChildCacheRetentionEntrypoint = {
currentModuleUrl: import.meta.url,
sourceWorkerName: "session-utils.child-cache-retention.test-support",
distWorkerPath: "gateway/session-utils.child-cache-retention.test-support.js",
} as const;
@@ -1,16 +1,14 @@
import { fileURLToPath } from "node:url";
import { expect, it } from "vitest";
import { runNodeScript } from "../../test/helpers/run-node-script.js";
import { resolveRuntimeWorkerArgv, resolveRuntimeWorkerUrl } from "../infra/runtime-worker-url.js";
import { sessionChildCacheRetentionEntrypoint } from "./session-child-cache-retention-entrypoint.test-support.js";
it("keeps child links without retaining released session metadata", async ({ signal }) => {
const result = await runNodeScript(
[
"--expose-gc",
"--import",
"tsx",
fileURLToPath(
new URL("./session-utils.child-cache-retention.test-support.ts", import.meta.url),
),
...resolveRuntimeWorkerArgv(resolveRuntimeWorkerUrl(sessionChildCacheRetentionEntrypoint)),
],
{ ...process.env, NODE_OPTIONS: "", TSX_DISABLE_CACHE: "1" },
15_000,