From e31b19df39f500b66267cbe3dc91cc7007158ceb Mon Sep 17 00:00:00 2001 From: Jeffrey Hardy Date: Fri, 4 Sep 2026 13:30:17 -0400 Subject: [PATCH] Keep the TUI socket tests under macOS's socket path cap A unix socket path may be at most 104 bytes on macOS, and the open-remote tests bound theirs inside t.TempDir(), which embeds the test name in an already long per-user temp path. The three tests failed on every Mac and passed on Linux CI, and since the release preflight runs the unit tests locally, releasing from a Mac was blocked too. A short directory straight under the temp root stays well inside the cap on either platform, and is how Go's own net tests place theirs. --- internal/tui/open_remote_unix_test.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/internal/tui/open_remote_unix_test.go b/internal/tui/open_remote_unix_test.go index 2039757f..04489195 100644 --- a/internal/tui/open_remote_unix_test.go +++ b/internal/tui/open_remote_unix_test.go @@ -162,9 +162,18 @@ func TestRunReportsTopicListenerConfigurationErrors(t *testing.T) { } } +// setPrivateRuntimeDir points the TUI at a private runtime directory the test owns. +// The directory is made under the system temp root with a short name rather than +// with t.TempDir(): a unix socket path is capped at 104 bytes on macOS, and +// t.TempDir() embeds the test name inside an already long per-user temp path, +// which put the socket over the cap and failed bind with "invalid argument". func setPrivateRuntimeDir(t *testing.T) { t.Helper() - runtimeDir := t.TempDir() + runtimeDir, err := os.MkdirTemp("", "hey") + if err != nil { + t.Fatalf("create runtime directory: %v", err) + } + t.Cleanup(func() { _ = os.RemoveAll(runtimeDir) }) if err := os.Chmod(runtimeDir, 0o700); err != nil { t.Fatalf("protect runtime directory: %v", err) }