Skip to content

fix(e2e): retain local dev output on failure - #2398

Merged
notgitika merged 1 commit into
aws:refactorfrom
Hweinstock:fix/project-dev-full-output
Sep 25, 2026
Merged

notgitika merged 1 commit into
aws:refactorfrom
Hweinstock:fix/project-dev-full-output

Conversation

@Hweinstock

Copy link
Copy Markdown
Contributor

Problem

Follow-up to #2394. That PR added logging of the last message written to stdout/stderr, but this is not enough information.

Solution

This PR dumps the entire output into the error.

Verification

Ran tests locally with a failure in dev and verified the output was there in local logs.

 × e2eTest/project/templates.test.ts > add, dev, deploy, invoke for runtime templates > local invocation > 'agent_python_minimal' runs locally 5006ms
   → agentcore dev exited with code 1.  
stdout/stderr = INJECTED
Error: FAILURE

 × e2eTest/project/templates.test.ts > add, dev, deploy, invoke for runtime templates > local invocation > 'agent_python_strands' runs locally 5006ms
   → agentcore dev exited with code 1.  
stdout/stderr = INJECTED
Error: FAILURE

 × e2eTest/project/templates.test.ts > add, dev, deploy, invoke for runtime templates > local invocation > 'py_strands_container' runs locally 5007ms
   → agentcore dev exited with code 1.  
stdout/stderr = INJECTED
Error: FAILURE

 × e2eTest/project/templates.test.ts > add, dev, deploy, invoke for runtime templates > local invocation > 'agent_python_langchain' runs locally 5007ms
   → agentcore dev exited with code 1.  
stdout/stderr = INJECTED
Error: FAILURE

 × e2eTest/project/templates.test.ts > add, dev, deploy, invoke for runtime templates > local invocation > 'agent_ts_strands' runs locally 5008ms
   → agentcore dev exited with code 1.  
stdout/stderr = INJECTED
Error: FAILURE

after adding:

 console.log("INJECTED");
 throw new Error("FAILURE");

into the dev handler.

@github-actions github-actions Bot added the size/xs PR size: XS label Sep 24, 2026
@agentcore-devx-automation agentcore-devx-automation Bot added agentcore-harness-reviewing AgentCore Harness review in progress claude-security-reviewing Claude Code /security-review in progress and removed agentcore-harness-reviewing AgentCore Harness review in progress labels Sep 24, 2026

@agentcore-devx-automation agentcore-devx-automation Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AgentCore Harness Review

Verdict: Looks good

Small, well-targeted test-only diagnostic improvement. The previous error messages interpolated pendingOutput, which only ever contains the trailing partial line (everything up to the last newline is consumed by lines = pendingOutput.split(...); pendingOutput = lines.pop()), so failure messages were nearly always empty. Accumulating a separate devOutput and using that in errors — plus fixing the stdout/stdout → stdout/stderr typo — makes flaky failures much easier to debug. devOutput growing unbounded is fine for a short-lived e2e test process. No new production code, so telemetry/mocking concerns don't apply. LGTM.

@agentcore-devx-automation

Copy link
Copy Markdown
Contributor

Claude Security Review: no high-confidence findings. (run)

@agentcore-devx-automation agentcore-devx-automation Bot removed the claude-security-reviewing Claude Code /security-review in progress label Sep 24, 2026
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.25%. Comparing base (5250b42) to head (0cbfc4c).

Additional details and impacted files
@@            Coverage Diff            @@
##           refactor    #2398   +/-   ##
=========================================
  Coverage     97.25%   97.25%           
=========================================
  Files           612      612           
  Lines         41004    41004           
=========================================
  Hits          39878    39878           
  Misses         1126     1126           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Hweinstock
Hweinstock marked this pull request as ready for review September 25, 2026 17:23
@notgitika
notgitika merged commit 4e2c592 into aws:refactor Sep 25, 2026
19 of 23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/xs PR size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants