Skip to content

SDCICD-1783 Capture stderr in test_output.log#3157

Merged
openshift-merge-bot[bot] merged 1 commit intoopenshift:mainfrom
YiqinZhang:SDCICD-1783
Mar 19, 2026
Merged

SDCICD-1783 Capture stderr in test_output.log#3157
openshift-merge-bot[bot] merged 1 commit intoopenshift:mainfrom
YiqinZhang:SDCICD-1783

Conversation

@YiqinZhang
Copy link
Contributor

@YiqinZhang YiqinZhang commented Mar 17, 2026

test_output.log previously captured only stdout, so critical stderr diagnostics were missing from the S3 artifact and Slack notifications.

  • This fix tees stderr into test_output.log with a safe fallback and drains all buffered output before exiting.
  • Captures Ginkgo failure messages per spec.

@openshift-ci-robot
Copy link

There are test jobs defined for this repository which are not configured to run automatically. Comment /test ? to see a list of all defined jobs. Review these jobs and use /test <job> to manually trigger jobs most likely to be impacted by the proposed changes.Comment /pipeline required to trigger all required & necessary jobs.

@coderabbitai
Copy link

coderabbitai bot commented Mar 17, 2026

Important

Review skipped

Auto reviews are limited based on label configuration.

🚫 Review skipped — only excluded labels are configured. (1)
  • do-not-merge/work-in-progress

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: 84b28976-ffd1-4de3-a460-867c8a0705f4

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
📝 Coding Plan
  • Generate coding plan for human review comments

Comment @coderabbitai help to get the list of available commands and usage tips.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 17, 2026

[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

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 17, 2026
@YiqinZhang
Copy link
Contributor Author

/pipeline required

@openshift-ci-robot
Copy link

Scheduling required tests:
/test hypershift-pr-check

@YiqinZhang YiqinZhang changed the title SDCICD-1754 Capture stderr in test_output.log SDCICD-1783 Capture stderr in test_output.log Mar 17, 2026
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
cmd/osde2e/main.go (1)

91-94: Handle tee-copy failure explicitly and close the read end

Line 93 suppresses tee-copy failures entirely, which can silently drop stderr capture. Also close stderrR in 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

📥 Commits

Reviewing files that changed from the base of the PR and between b4de290 and 1bb0b75.

📒 Files selected for processing (1)
  • cmd/osde2e/main.go

@YiqinZhang YiqinZhang force-pushed the SDCICD-1783 branch 4 times, most recently from 7ff8f59 to 539c3c7 Compare March 18, 2026 13:49
@YiqinZhang
Copy link
Contributor Author

/test hypershift-pr-check

@YiqinZhang
Copy link
Contributor Author

YiqinZhang commented Mar 18, 2026

@YiqinZhang YiqinZhang force-pushed the SDCICD-1783 branch 4 times, most recently from 62db8e9 to ab847b6 Compare March 18, 2026 22:27
@YiqinZhang
Copy link
Contributor Author

/test hypershift-pr-check

@ritmun
Copy link
Contributor

ritmun commented Mar 19, 2026

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Mar 19, 2026
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 19, 2026

@YiqinZhang: all tests passed!

Full PR test history. Your PR dashboard.

Details

Instructions 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.

@openshift-merge-bot openshift-merge-bot bot merged commit 22c7131 into openshift:main Mar 19, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants