Skip to content

pkg/compose: fix TestRunHook_ConsoleSize on macOS#13686

Merged
glours merged 1 commit intodocker:mainfrom
thaJeztah:fix_TestRunHook_ConsoleSize
Mar 30, 2026
Merged

pkg/compose: fix TestRunHook_ConsoleSize on macOS#13686
glours merged 1 commit intodocker:mainfrom
thaJeztah:fix_TestRunHook_ConsoleSize

Conversation

@thaJeztah
Copy link
Copy Markdown
Member

relates to:

containerd/console is broken on macOS, and panics; use creack/pty instead for this test.

What I did

Related issue

(not mandatory) A picture of a cute animal, if possible in relation to what you did

@thaJeztah thaJeztah requested a review from a team as a code owner March 29, 2026 21:04
@thaJeztah thaJeztah requested review from Copilot, glours and ndeloof March 29, 2026 21:04
@thaJeztah thaJeztah force-pushed the fix_TestRunHook_ConsoleSize branch from 57a1592 to 357ab2c Compare March 29, 2026 21:06
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the pkg/compose hook console-size unit test to avoid containerd/console PTY usage (which can panic on macOS) by switching the test PTY implementation.

Changes:

  • Replace github.com/containerd/console.NewPty() usage with github.com/creack/pty.Open() in TestRunHook_ConsoleSize.
  • Switch cleanup from defer to t.Cleanup for PTY file handles.
  • Add a (currently empty) TestConsole test stub.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

containerd/console is broken on macOS, and panics; use creack/pty
instead for this test.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah thaJeztah force-pushed the fix_TestRunHook_ConsoleSize branch from 357ab2c to feb2dab Compare March 29, 2026 22:21
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 29, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Copy link
Copy Markdown
Contributor

@glours glours left a comment

Choose a reason for hiding this comment

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

LGTM

@glours glours merged commit 5bbdd23 into docker:main Mar 30, 2026
40 checks passed
@thaJeztah thaJeztah deleted the fix_TestRunHook_ConsoleSize branch March 30, 2026 08:00
@thaJeztah
Copy link
Copy Markdown
Member Author

Thx! We should look if we can fix containerd/console, but I ran tests on my machine, and thought I broke something, then found it was already like this 😂

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.

3 participants