[PR #464] [CLOSED] Test pipe draining #547

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/464
Author: @cursor[bot]
Created: 2/9/2026
Status: Closed

Base: audit/fix-security-and-test-gapsHead: cursor/test-pipe-draining-26e8


📝 Commits (1)

  • cb01d7c Fix pipe capture helpers to drain concurrently, preventing potential deadlock

📊 Changes

2 files changed (+32 additions, -20 deletions)

View changed files

📝 cmd/run_additional_test.go (+16 -10)
📝 internal/cli/auth/auth_test.go (+16 -10)

📄 Description

Refactor captureCommandOutput and captureAuthOutput to concurrently drain pipes, preventing potential deadlocks in tests.

The original implementation could lead to a deadlock if the function under test (fn()) wrote enough data to fill the OS pipe buffer, as the pipes were only read after fn() completed. This change introduces goroutines to drain the pipes concurrently, matching the pattern in completion_test.go.



🔄 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/464 **Author:** [@cursor[bot]](https://github.com/apps/cursor) **Created:** 2/9/2026 **Status:** ❌ Closed **Base:** `audit/fix-security-and-test-gaps` ← **Head:** `cursor/test-pipe-draining-26e8` --- ### 📝 Commits (1) - [`cb01d7c`](https://github.com/rudrankriyam/App-Store-Connect-CLI/commit/cb01d7c2d475c8369ebf4e96c115f699125ac056) Fix pipe capture helpers to drain concurrently, preventing potential deadlock ### 📊 Changes **2 files changed** (+32 additions, -20 deletions) <details> <summary>View changed files</summary> 📝 `cmd/run_additional_test.go` (+16 -10) 📝 `internal/cli/auth/auth_test.go` (+16 -10) </details> ### 📄 Description Refactor `captureCommandOutput` and `captureAuthOutput` to concurrently drain pipes, preventing potential deadlocks in tests. The original implementation could lead to a deadlock if the function under test (`fn()`) wrote enough data to fill the OS pipe buffer, as the pipes were only read after `fn()` completed. This change introduces goroutines to drain the pipes concurrently, matching the pattern in `completion_test.go`. --- --- <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#547
No description provided.