detached 0a8685a

test(resilience): use short control socket path in relay tests

macOS t.TempDir paths exceed the 104-byte AF_UNIX limit, so the relay could not bind its control socket on the macOS runner.
commit
0a8685a671dfe27ba7b69505d4e3d9809f718a52
author
brice · · 2026-10-07 06:43 UTC
parent
4c975c7
signature
GPG VerifiedCD88F9E564E0102646FB6077A1A07C7C7C3E349D · arch-gpg Verified for the committer email
1 file · +13 -6
M scripts/remote-resilience-harness/relay/main_test.go +13 -6
@@ -41,12 +41,21 @@ func TestTCPRelayPreservesBytesAndStops(t *testing.T) {
4141 require.Equal(t, uint64(len(payload)), r.bytes.Load())
4242 }
4343
44+// controlSocketPath returns a socket path in a short private directory: the
45+// macOS t.TempDir path exceeds the 104-byte AF_UNIX limit.
46+func controlSocketPath(t *testing.T) string {
47+ t.Helper()
48+ directory, err := os.MkdirTemp("/tmp", "relay")
49+ require.NoError(t, err)
50+ t.Cleanup(func() { _ = os.RemoveAll(directory) })
51+ require.NoError(t, os.Chmod(directory, 0700))
52+ return filepath.Join(directory, "control.sock")
53+}
54+
4455 func TestRelayShutdownClosesListeners(t *testing.T) {
4556 ctx, cancel := context.WithCancel(t.Context())
4657 r := &relay{ctx: ctx, cancel: cancel, connections: make(map[net.Conn]struct{})}
47- directory := t.TempDir()
48- require.NoError(t, os.Chmod(directory, 0700))
49- path := filepath.Join(directory, "control.sock")
58+ path := controlSocketPath(t)
5059 done := make(chan error, 1)
5160 go func() { done <- r.serve("127.0.0.1:0", path) }()
5261 require.Eventually(t, func() bool { _, err := os.Stat(path); return err == nil }, time.Second, time.Millisecond)
@@ -115,9 +124,7 @@ func TestRelayControlRoundTrip(t *testing.T) {
115124 ctx, cancel := context.WithCancel(t.Context())
116125 defer cancel()
117126 r := &relay{ctx: ctx, cancel: cancel, connections: make(map[net.Conn]struct{})}
118- directory := t.TempDir()
119- require.NoError(t, os.Chmod(directory, 0700))
120- path := filepath.Join(directory, "control.sock")
127+ path := controlSocketPath(t)
121128 done := make(chan error, 1)
122129 go func() { done <- r.serve("127.0.0.1:0", path) }()
123130 require.Eventually(t, func() bool { _, err := os.Stat(path); return err == nil }, time.Second, time.Millisecond)
@@ -41,12 +41,21 @@ func TestTCPRelayPreservesBytesAndStops(t *testing.T) {
41 require.Equal(t, uint64(len(payload)), r.bytes.Load())41 require.Equal(t, uint64(len(payload)), r.bytes.Load())
42 }42 }
43 43
44+// controlSocketPath returns a socket path in a short private directory: the
45+// macOS t.TempDir path exceeds the 104-byte AF_UNIX limit.
46+func controlSocketPath(t *testing.T) string {
47+ t.Helper()
48+ directory, err := os.MkdirTemp("/tmp", "relay")
49+ require.NoError(t, err)
50+ t.Cleanup(func() { _ = os.RemoveAll(directory) })
51+ require.NoError(t, os.Chmod(directory, 0700))
52+ return filepath.Join(directory, "control.sock")
53+}
54+
44 func TestRelayShutdownClosesListeners(t *testing.T) {55 func TestRelayShutdownClosesListeners(t *testing.T) {
45 ctx, cancel := context.WithCancel(t.Context())56 ctx, cancel := context.WithCancel(t.Context())
46 r := &relay{ctx: ctx, cancel: cancel, connections: make(map[net.Conn]struct{})}57 r := &relay{ctx: ctx, cancel: cancel, connections: make(map[net.Conn]struct{})}
47- directory := t.TempDir()58+ path := controlSocketPath(t)
48- require.NoError(t, os.Chmod(directory, 0700))
49- path := filepath.Join(directory, "control.sock")
50 done := make(chan error, 1)59 done := make(chan error, 1)
51 go func() { done <- r.serve("127.0.0.1:0", path) }()60 go func() { done <- r.serve("127.0.0.1:0", path) }()
52 require.Eventually(t, func() bool { _, err := os.Stat(path); return err == nil }, time.Second, time.Millisecond)61 require.Eventually(t, func() bool { _, err := os.Stat(path); return err == nil }, time.Second, time.Millisecond)
@@ -115,9 +124,7 @@ func TestRelayControlRoundTrip(t *testing.T) {
115 ctx, cancel := context.WithCancel(t.Context())124 ctx, cancel := context.WithCancel(t.Context())
116 defer cancel()125 defer cancel()
117 r := &relay{ctx: ctx, cancel: cancel, connections: make(map[net.Conn]struct{})}126 r := &relay{ctx: ctx, cancel: cancel, connections: make(map[net.Conn]struct{})}
118- directory := t.TempDir()127+ path := controlSocketPath(t)
119- require.NoError(t, os.Chmod(directory, 0700))
120- path := filepath.Join(directory, "control.sock")
121 done := make(chan error, 1)128 done := make(chan error, 1)
122 go func() { done <- r.serve("127.0.0.1:0", path) }()129 go func() { done <- r.serve("127.0.0.1:0", path) }()
123 require.Eventually(t, func() bool { _, err := os.Stat(path); return err == nil }, time.Second, time.Millisecond)130 require.Eventually(t, func() bool { _, err := os.Stat(path); return err == nil }, time.Second, time.Millisecond)

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 12

Tags 11

↑↓ moveenter openesc close