From f80193fa4c3b0d5b2e5ed50cec0402cf5114a5fe Mon Sep 17 00:00:00 2001 From: Josh Bleecher Snyder Date: Tue, 20 Jul 2021 12:13:20 -0700 Subject: [PATCH] tstest/integration: shorten test names The maximum unix domain socket path length on darwin is 104 bytes, including the trailing NUL. On my machine, the path created by some newly added tests (6eecf3c9) was too long, resulting in cryptic test failures. Shorten the names of the tests, and add a check to make the diagnosis easier next time. Signed-off-by: Josh Bleecher Snyder --- tstest/integration/integration_test.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tstest/integration/integration_test.go b/tstest/integration/integration_test.go index 8f0835db0..8d5c0a71a 100644 --- a/tstest/integration/integration_test.go +++ b/tstest/integration/integration_test.go @@ -314,7 +314,7 @@ func TestAddPingRequest(t *testing.T) { // Issue 2434: when "down" (WantRunning false), tailscaled shouldn't // be connected to control. -func TestNoControlConnectionWhenDown(t *testing.T) { +func TestNoControlConnWhenDown(t *testing.T) { t.Parallel() bins := BuildTestBinaries(t) @@ -361,7 +361,7 @@ func TestNoControlConnectionWhenDown(t *testing.T) { // Issue 2137: make sure Windows tailscaled works with the CLI alone, // without the GUI to kick off a Start. -func TestOneNodeUp_WindowsStyle(t *testing.T) { +func TestOneNodeUpWindowsStyle(t *testing.T) { t.Parallel() bins := BuildTestBinaries(t) @@ -471,10 +471,14 @@ type testNode struct { // The node is not started automatically. func newTestNode(t *testing.T, env *testEnv) *testNode { dir := t.TempDir() + sockFile := filepath.Join(dir, "tailscale.sock") + if len(sockFile) >= 104 { + t.Fatalf("sockFile path %q (len %v) is too long, must be < 104", sockFile, len(sockFile)) + } return &testNode{ env: env, dir: dir, - sockFile: filepath.Join(dir, "tailscale.sock"), + sockFile: sockFile, stateFile: filepath.Join(dir, "tailscale.state"), } }