-
Notifications
You must be signed in to change notification settings - Fork 17.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
testing: TB.TempDir paths can be too long for Unix socket paths #62614
Comments
FWIW I've also seen similar failures in a non-test context with I've not reported it before because I didn't really know what to propose other than your "operating systems to be less annoying" expectation. 😀 I expect it's defensible for the |
cc @bcmills |
That's less about In theory
Probably a better replacement for |
Ah, I didn't know about If we wanted to be really (too?) fancy, we could make the error message on failure to open up a long unix socket refer to |
What version of Go are you using (
go version
)?Go 1.21
darwin/arm64
What did you do?
I renamed a test to make it more descriptive (longer) and then my test failed:
Turns out darwin, openbsd, and freebsd at least limit the length of a unix socket to 104 bytes.
Because
os.TempDir
on darwin is a long user-specific thing (e.g./var/folders/0f/7sz95dc94nj46b6yz8p_fqd40000gn/
) andtesting.TB.TempDir
includes the test name and some suffix (TestIncrementalMapUpdatePeersRemoved1080118162
), by the time those are all concatenated, you're out of space for a unix socket filename that fits in 104 bytes.Apparently @josharian discovered this two years ago in tailscale/tailscale@f80193f where I approved a rename to make test names shorter but it didn't cross my mind to file this bug until I just hit it again now.
I ended up working around it by:
But that's a little gross.
What did you expect to see?
Operating systems to be less annoying. Failing that, maybe the testing package could help work around it somehow?
What did you see instead?
Failure to make a unix socket in a test.
The text was updated successfully, but these errors were encountered: