test: remove stale limits and handoff expectations

This commit is contained in:
morluto
2026-09-29 17:00:16 +08:00
parent ecf3ed8bdb
commit acf33d6df2
22 changed files with 206 additions and 156 deletions
@@ -227,7 +227,6 @@ const electronRuntimeEvidence = (
const sourceIncluded = options.sourceIncluded ?? true;
const input = inspectElectronPageInputSchema.parse({
cdp_endpoint: "http://127.0.0.1:9223",
allowed_file_roots: [root],
target_id: targetId,
observation_ms: 100,
include_script_sources: sourceIncluded,
+11 -7
View File
@@ -159,13 +159,13 @@ describe("provider process runtime and wait primitives", () => {
});
describe("provider process output and cleanup primitives", () => {
it("captures exact byte totals while bounding retained stdout and stderr", async () => {
const child = spawnProviderProcessFixture("burst", 4_096);
it("retains complete stdout and stderr beyond the former fixed ceiling", async () => {
const outputBytes = 70_000;
const child = spawnProviderProcessFixture("burst", outputBytes);
const diagnostics: ProviderProcessDiagnostic[] = [];
const supervisor = new ProviderProcessSupervisor(
{ process: child, ownsProcessLifetime: true },
{
maxOutputBytesPerStream: 64,
onDiagnostic: (event) => diagnostics.push(event),
},
);
@@ -173,13 +173,17 @@ describe("provider process output and cleanup primitives", () => {
await expect(supervisor.waitForExit(2_000)).resolves.toBe(true);
const snapshot = supervisor.snapshot();
expect(snapshot).toMatchObject({
stdout: { bytes: 4_096, retainedBytes: 64, truncated: true },
stderr: { bytes: 4_096, retainedBytes: 64, truncated: true },
stdout: {
bytes: outputBytes,
},
stderr: {
bytes: outputBytes,
},
exitCode: 23,
signal: null,
});
expect(snapshot.stdout.text).toBe("o".repeat(64));
expect(snapshot.stderr.text).toBe("e".repeat(64));
expect(snapshot.stdout.text).toBe("o".repeat(outputBytes));
expect(snapshot.stderr.text).toBe("e".repeat(outputBytes));
expect(diagnostics).toContainEqual(
expect.objectContaining({ type: "exit", code: 23 }),
);
@@ -43,30 +43,6 @@ describe("runtime executable diagnostics", () => {
expect(pathNodes.every(({ healthy }) => healthy)).toBe(true);
});
it("reports every PATH candidate beyond the former per-tool cap", async () => {
const directories = await Promise.all(
Array.from({ length: 17 }, () => temporaryRoot()),
);
await Promise.all(
directories.map((directory) =>
symlink(process.execPath, join(directory, "node")),
),
);
const inventory = await inspectRuntimeExecutables({
platform: process.platform,
path: directories.join(delimiter),
launcherNode: process.execPath,
});
expect(
inventory.candidates.filter(
({ tool, path_index: pathIndex }) =>
tool === "node" && pathIndex !== null,
),
).toHaveLength(17);
});
it("distinguishes a healthy primary runtime from a broken shadowed candidate", async () => {
const healthy = await temporaryRoot();
const broken = await temporaryRoot();
@@ -169,6 +145,51 @@ describe("runtime executable diagnostics", () => {
});
});
describe("complete runtime diagnostics", () => {
it("reports every PATH candidate", async () => {
const directories = await Promise.all(
Array.from({ length: 17 }, () => temporaryRoot()),
);
await Promise.all(
directories.map((directory) =>
symlink(process.execPath, join(directory, "node")),
),
);
const inventory = await inspectRuntimeExecutables({
platform: process.platform,
path: directories.join(delimiter),
launcherNode: process.execPath,
});
expect(
inventory.candidates.filter(
({ tool, path_index: pathIndex }) =>
tool === "node" && pathIndex !== null,
),
).toHaveLength(17);
});
it("preserves complete diagnostics", async () => {
const root = await temporaryRoot();
await executable(
join(root, "node"),
"#!/bin/sh\nprintf '%070000d' 0 >&2\nexit 17\n",
);
const inventory = await inspectRuntimeExecutables({
platform: process.platform,
path: root,
launcherNode: process.execPath,
});
const candidate = inventory.candidates.find(
({ tool, path_index: pathIndex }) => tool === "node" && pathIndex === 0,
);
expect(candidate?.failure?.stderr).toHaveLength(70_000);
});
});
const temporaryRoot = async (): Promise<string> => {
const root = await createTestTempDirectory("rea-runtime-diagnostics-");
roots.push(root);