From 0cbfc4c0dbe9910a7b5b4afc00673fb91403eee7 Mon Sep 17 00:00:00 2001 From: Hweinstock Date: Wed, 23 Sep 2026 23:36:44 +0000 Subject: [PATCH] fix(e2e): retain local dev output on failure --- e2eTest/project/templates.test.ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/e2eTest/project/templates.test.ts b/e2eTest/project/templates.test.ts index 66d2e98aa..133c9d685 100644 --- a/e2eTest/project/templates.test.ts +++ b/e2eTest/project/templates.test.ts @@ -187,10 +187,13 @@ describe( const runtimePorts = new Map(); let dev: ReturnType | undefined; let pendingOutput = ""; + let devOutput = ""; /** Given dev-process output, records the ports announced by running runtimes. */ const captureDevOutput = (chunk: Buffer) => { - pendingOutput += chunk.toString(); + const text = chunk.toString(); + devOutput += text; + pendingOutput += text; const lines = pendingOutput.split(/\r?\n/); pendingOutput = lines.pop() ?? ""; @@ -221,21 +224,21 @@ describe( async (runtime) => { const sessionId = getSessionId(`${runtime.name}`); - // the server may take a bit to get ready, so we retry on a timeout. + // The server may take a bit to get ready, so we retry on a timeout. const response = await retry(async () => { if (!dev) { - throw new Error(`agentcore dev did not start. \nstdout/stdout = ${pendingOutput}`); + throw new Error(`agentcore dev did not start. \nstdout/stderr = ${devOutput}`); } if (dev.exitCode !== null) { throw new Error( - `agentcore dev exited with code ${dev.exitCode ?? "unknown"}. \nstdout/stdout = ${pendingOutput}`, + `agentcore dev exited with code ${dev.exitCode ?? "unknown"}. \nstdout/stderr = ${devOutput}`, ); } const port = runtimePorts.get(runtime.name); if (!port) { throw new Error( - `Runtime '${runtime.name}' is not ready. \nstdout/stdout = ${pendingOutput}`, + `Runtime '${runtime.name}' is not ready. \nstdout/stderr = ${devOutput}`, ); }