From 79d5b9a826b9204c1ef59b0a5c5ec83e7a2f2bec Mon Sep 17 00:00:00 2001 From: morluto <76467478+morluto@users.noreply.github.com> Date: Sat, 10 Oct 2026 03:43:26 +0800 Subject: [PATCH] test(process): report cleanup details on cancellation failures --- .../process/processCaptureCancellationAdapters.test.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/boundary/process/processCaptureCancellationAdapters.test.ts b/tests/boundary/process/processCaptureCancellationAdapters.test.ts index 7a7159e91..694f83409 100644 --- a/tests/boundary/process/processCaptureCancellationAdapters.test.ts +++ b/tests/boundary/process/processCaptureCancellationAdapters.test.ts @@ -8,6 +8,7 @@ import { Client, InMemoryTransport } from "@modelcontextprotocol/client"; import pino from "pino"; import { expect, onTestFinished } from "vitest"; import { z } from "zod"; +import { analysisCliErrorEnvelopeSchema } from "../../../src/contracts/errorSchemas.js"; import { cleanupOwnedProcessGroup } from "../../../src/process/ProcessOwnership.js"; import { createServer } from "../../../src/server/createServer.js"; import { @@ -124,7 +125,8 @@ itWithCaptureCapability.each(["SIGINT", "SIGTERM"] as const)( await expect(access(join(root, "late-write"))).rejects.toMatchObject({ code: "ENOENT", }); - expect(JSON.parse(stdout)).toMatchObject({ + const result = analysisCliErrorEnvelopeSchema.parse(JSON.parse(stdout)); + expect(result, JSON.stringify(result.details)).toMatchObject({ code: "cancelled", details: { operation: "process_capture", cleanup: "complete" }, });