SDCICD-1783 Capture stderr in test_output.log#3157
SDCICD-1783 Capture stderr in test_output.log#3157openshift-merge-bot[bot] merged 1 commit intoopenshift:mainfrom
Conversation
|
There are test jobs defined for this repository which are not configured to run automatically. Comment |
|
Important Review skippedAuto reviews are limited based on label configuration. 🚫 Review skipped — only excluded labels are configured. (1)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Comment |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: YiqinZhang The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/pipeline required |
|
Scheduling required tests: |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
cmd/osde2e/main.go (1)
91-94: Handle tee-copy failure explicitly and close the read endLine 93 suppresses tee-copy failures entirely, which can silently drop stderr capture. Also close
stderrRin the goroutine to keep descriptor lifecycle explicit.Suggested refinement
go func() { defer close(stderrDone) - _, _ = io.Copy(io.MultiWriter(origStderr, logFile), stderrR) + defer stderrR.Close() + if _, copyErr := io.Copy(io.MultiWriter(origStderr, logFile), stderrR); copyErr != nil { + _, _ = fmt.Fprintf(origStderr, "stderr tee copy failed: %v\n", copyErr) + } }()As per coding guidelines,
**/*.go: Review the Go code, point out issues relative to principles of clean code, security and performance.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@cmd/osde2e/main.go` around lines 91 - 94, The anonymous goroutine that tees stderr suppresses errors and doesn't close the read end; update the goroutine that uses io.Copy(io.MultiWriter(origStderr, logFile), stderrR) (the one closing stderrDone) to defer stderrR.Close(), capture and check the error returned by io.Copy, and log or propagate that error instead of discarding it (use process logger or return channel), ensuring the stderrR lifecycle and tee-copy failures are handled explicitly; keep closing stderrDone in a defer after handling the error.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@cmd/osde2e/main.go`:
- Around line 118-123: The shutdown currently blocks forever waiting on
stderrDone after closing stderrW (symbols: stderrW, stderrDone, exitCode);
change the wait to a bounded wait by using a select that waits for stderrDone or
a timeout (e.g., time.After with a reasonable duration) so the process will
proceed to os.Exit(exitCode) even if the copy goroutine stalls; ensure you still
close stderrW before waiting and log or note if the drain timed out for
diagnostics.
---
Nitpick comments:
In `@cmd/osde2e/main.go`:
- Around line 91-94: The anonymous goroutine that tees stderr suppresses errors
and doesn't close the read end; update the goroutine that uses
io.Copy(io.MultiWriter(origStderr, logFile), stderrR) (the one closing
stderrDone) to defer stderrR.Close(), capture and check the error returned by
io.Copy, and log or propagate that error instead of discarding it (use process
logger or return channel), ensuring the stderrR lifecycle and tee-copy failures
are handled explicitly; keep closing stderrDone in a defer after handling the
error.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Organization UI (inherited)
Review profile: CHILL
Plan: Pro
Run ID: b41a4b86-aa26-45ca-ba85-54ad82598708
📒 Files selected for processing (1)
cmd/osde2e/main.go
7ff8f59 to
539c3c7
Compare
|
/test hypershift-pr-check |
62db8e9 to
ab847b6
Compare
|
/test hypershift-pr-check |
|
/lgtm |
|
@YiqinZhang: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
test_output.log previously captured only stdout, so critical stderr diagnostics were missing from the S3 artifact and Slack notifications.