From 2a31813d1fcfaf8cec57d192576fc4473b207149 Mon Sep 17 00:00:00 2001 From: Shakker Date: Mon, 11 May 2026 02:08:22 +0100 Subject: [PATCH] test: tighten cleanup timeout warning assertions --- src/agents/run-cleanup-timeout.test.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/agents/run-cleanup-timeout.test.ts b/src/agents/run-cleanup-timeout.test.ts index f9080f71ae6..1f43e3c9371 100644 --- a/src/agents/run-cleanup-timeout.test.ts +++ b/src/agents/run-cleanup-timeout.test.ts @@ -30,8 +30,9 @@ describe("agent cleanup timeout", () => { await expect(result).resolves.toBeUndefined(); expect(cleanup).toHaveBeenCalledTimes(1); - expect(log.warn).toHaveBeenCalledWith(expect.stringContaining("agent cleanup timed out:")); - expect(log.warn).toHaveBeenCalledWith(expect.stringContaining("step=bundle-mcp-retire")); + expect(log.warn).toHaveBeenCalledWith( + "agent cleanup timed out: runId=run-1 sessionId=session-1 step=bundle-mcp-retire timeoutMs=10000", + ); }); it("logs cleanup rejection without throwing", async () => { @@ -47,7 +48,8 @@ describe("agent cleanup timeout", () => { }), ).resolves.toBeUndefined(); - expect(log.warn).toHaveBeenCalledWith(expect.stringContaining("agent cleanup failed:")); - expect(log.warn).toHaveBeenCalledWith(expect.stringContaining("dispose failed")); + expect(log.warn).toHaveBeenCalledWith( + "agent cleanup failed: runId=run-2 sessionId=session-2 step=context-engine-dispose error=dispose failed", + ); }); });