Skip to content

Show error logs when test ends due to TIMEOUT#417

Draft
vinnybod wants to merge 1 commit into
bazel-contrib:mainfrom
vinnybod:vinnybod/timeout-stdout-capture
Draft

Show error logs when test ends due to TIMEOUT#417
vinnybod wants to merge 1 commit into
bazel-contrib:mainfrom
vinnybod:vinnybod/timeout-stdout-capture

Conversation

@vinnybod

@vinnybod vinnybod commented Feb 4, 2026

Copy link
Copy Markdown
Contributor

When a test times out, stdout/stderr output that was already written is now captured and included in the test report XML. This helps diagnose timeout issues by preserving any logging or print statements that occurred before the timeout interrupt.

The current behavior only shows Test timed out and was interrupted

Edit: This is probably still not a great solution because the "fallback" stream has the logs from every test case.

When a test times out, stdout/stderr output that was already written is
now captured and included in the test report XML. This helps diagnose
timeout issues by preserving any logging or print statements that
occurred before the timeout interrupt.

- Add OutputCapture class that uses TeeOutputStream to capture output
- Wire OutputCapture into ActualRunner for timeout scenarios
- Inject fallback output into BazelJUnitOutputListener on interrupt
- Add fallback stdout/stderr fields to TestData
@vinnybod vinnybod marked this pull request as draft February 4, 2026 21:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant