Summary
On Windows, in-tree AF_UNIX discovery tests fail at HEAD (3c4dec3). Named-pipe (npipe://) tests on the same machine pass. No container runtime is involved.
I intend to implement a fix. Per CONTRIBUTING I will wait for assignment before opening a PR.
Environment
- Windows 11,
go version go1.26.5 windows/amd64
- HEAD:
3c4dec3
go test ./pkg/server/discovery/ -count=1 -run "TestParseUnixSocketPath_Valid$|TestHTTPClientForURL_SchemeDispatchCaseInsensitive|TestCheckHealth_UnixSocket_Success$"
Failures
POSIX unix:/// paths rejected as relative
ParseUnixSocketPath("unix:///var/run/thv.sock") returns:
unix socket path must be absolute: \var\run\thv.sock
filepath.Clean on Windows turns /var/run/thv.sock into \var\run\thv.sock, and filepath.IsAbs is false because there is no volume. Same for HTTPClientForURL("UNIX:///tmp/thv.sock") -> \tmp\thv.sock.
Concatenating unix:// + a drive path is not a valid URL
TestCheckHealth_UnixSocket_Success builds "unix://"+socketPath. On Windows that is unix://C:\Users\...\test.sock. url.Parse rejects it:
invalid server URL: parse "unix://C:\\Users\\stans\\AppData\\Local\\Temp\\thv-3078206842\\test.sock": invalid port ":\\Users\\stans\\AppData\\Local\\Temp\\thv-3078206842\\test.sock" after host
pkg/api/socket_windows.go already documents this and emits unix:///C:%5Cpath%5Cthv.sock. The discovery tests still concatenate.
ListenURL four slashes
Windows socketURL does Path: "/" + address. When address is already /tmp/test.sock, ListenURL returns unix:////tmp/test.sock (four slashes) instead of unix:///tmp/test.sock. The Unix build of socketURL uses Path: address and does not add that extra slash.
What is not broken
- Named-pipe setup, DACL, and first-instance-wins tests are green.
TestSocketURL_RoundTrip_AFUnix for C:\path\thv.sock via socketURL() already percent-encodes correctly.
Direction (after assignment)
Keep the three-slash encoded form that socket_windows.go already documents. Make ParseUnixSocketPath accept POSIX unix:///var/run/... on Windows (or skip those cases on Windows). Stop tests from concatenating unix:// + a drive path; use socketURL / url.URL. Do not prepend / when address already starts with /.
Happy to take this once assigned.
Filed with AI assistance (Cursor/Grok). Reproduced on this machine.
Summary
On Windows, in-tree AF_UNIX discovery tests fail at HEAD (
3c4dec3). Named-pipe (npipe://) tests on the same machine pass. No container runtime is involved.I intend to implement a fix. Per CONTRIBUTING I will wait for assignment before opening a PR.
Environment
go version go1.26.5 windows/amd643c4dec3Failures
POSIX
unix:///paths rejected as relativeParseUnixSocketPath("unix:///var/run/thv.sock")returns:filepath.Cleanon Windows turns/var/run/thv.sockinto\var\run\thv.sock, andfilepath.IsAbsis false because there is no volume. Same forHTTPClientForURL("UNIX:///tmp/thv.sock")->\tmp\thv.sock.Concatenating
unix://+ a drive path is not a valid URLTestCheckHealth_UnixSocket_Successbuilds"unix://"+socketPath. On Windows that isunix://C:\Users\...\test.sock.url.Parserejects it:pkg/api/socket_windows.goalready documents this and emitsunix:///C:%5Cpath%5Cthv.sock. The discovery tests still concatenate.ListenURLfour slashesWindows
socketURLdoesPath: "/" + address. Whenaddressis already/tmp/test.sock,ListenURLreturnsunix:////tmp/test.sock(four slashes) instead ofunix:///tmp/test.sock. The Unix build ofsocketURLusesPath: addressand does not add that extra slash.What is not broken
TestSocketURL_RoundTrip_AFUnixforC:\path\thv.sockviasocketURL()already percent-encodes correctly.Direction (after assignment)
Keep the three-slash encoded form that
socket_windows.goalready documents. MakeParseUnixSocketPathaccept POSIXunix:///var/run/...on Windows (or skip those cases on Windows). Stop tests from concatenatingunix://+ a drive path; usesocketURL/url.URL. Do not prepend/whenaddressalready starts with/.Happy to take this once assigned.
Filed with AI assistance (Cursor/Grok). Reproduced on this machine.