From ab74ea0a67cb874684f6fca28c4293a5b5dde35b Mon Sep 17 00:00:00 2001 From: Avery Pennarun Date: Mon, 13 Apr 2026 03:52:09 +0200 Subject: [PATCH] tstest/integration: clear SSH_CLIENT env to prevent false positive detection When running integration tests over SSH (e.g., in remote development environments), the SSH_CLIENT environment variable is set. This causes isSSHOverTailscale() to incorrectly detect an SSH session and change behavior. Clear SSH_CLIENT in the test node environment to prevent these false positives. Fixes #19393 Change-Id: I1411abf0be9704cce37051476efb04d59beed386 Signed-off-by: Avery Pennarun --- tstest/integration/integration.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tstest/integration/integration.go b/tstest/integration/integration.go index a98df8180..f4bf9ebdd 100644 --- a/tstest/integration/integration.go +++ b/tstest/integration/integration.go @@ -1044,6 +1044,9 @@ func (n *TestNode) Tailscale(arg ...string) *exec.Cmd { cmd.Env = append(os.Environ(), "TS_DEBUG_UP_FLAG_GOOS="+n.upFlagGOOS, "TS_LOGS_DIR="+n.env.t.TempDir(), + "SSH_CLIENT=", // Clear SSH_CLIENT to prevent isSSHOverTailscale() false positives in tests + "SSH_CONNECTION=", // just in case + "SSH_AUTH_SOCK=", // just in case ) if *verboseTailscale { cmd.Stdout = os.Stdout