[PR #465] [MERGED] Global output defer #548

Closed
opened 2026-02-26 22:31:27 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/rudrankriyam/App-Store-Connect-CLI/pull/465
Author: @cursor[bot]
Created: 2/9/2026
Status: Merged
Merged: 2/10/2026
Merged by: @rudrankriyam

Base: audit/fix-security-and-test-gapsHead: cursor/global-output-defer-1b3e


📝 Commits (1)

  • 8df2015 Fix missing defer restoration for global stdout/stderr swap in test helpers

📊 Changes

2 files changed (+52 additions, -24 deletions)

View changed files

📝 cmd/run_additional_test.go (+26 -12)
📝 internal/cli/auth/auth_test.go (+26 -12)

📄 Description

Refactor captureCommandOutput and captureAuthOutput to use defer for stdout/stderr restoration and concurrent goroutines for pipe reading.

This fixes a bug where os.Stdout/os.Stderr might not be restored if t.Fatalf (which triggers runtime.Goexit) is called within the captured function, leading to corrupted test output. It also prevents potential deadlocks by reading pipe output concurrently.



🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/rudrankriyam/App-Store-Connect-CLI/pull/465 **Author:** [@cursor[bot]](https://github.com/apps/cursor) **Created:** 2/9/2026 **Status:** ✅ Merged **Merged:** 2/10/2026 **Merged by:** [@rudrankriyam](https://github.com/rudrankriyam) **Base:** `audit/fix-security-and-test-gaps` ← **Head:** `cursor/global-output-defer-1b3e` --- ### 📝 Commits (1) - [`8df2015`](https://github.com/rudrankriyam/App-Store-Connect-CLI/commit/8df201516a0b667c1fc873870a5bd977cf628710) Fix missing defer restoration for global stdout/stderr swap in test helpers ### 📊 Changes **2 files changed** (+52 additions, -24 deletions) <details> <summary>View changed files</summary> 📝 `cmd/run_additional_test.go` (+26 -12) 📝 `internal/cli/auth/auth_test.go` (+26 -12) </details> ### 📄 Description Refactor `captureCommandOutput` and `captureAuthOutput` to use `defer` for stdout/stderr restoration and concurrent goroutines for pipe reading. This fixes a bug where `os.Stdout`/`os.Stderr` might not be restored if `t.Fatalf` (which triggers `runtime.Goexit`) is called within the captured function, leading to corrupted test output. It also prevents potential deadlocks by reading pipe output concurrently. --- --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-26 22:31:27 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/App-Store-Connect-CLI#548
No description provided.