summaryrefslogtreecommitdiffhomepage
path: root/control/controlhttp/controlhttpserver/controlhttpserver.go
diff options
context:
space:
mode:
authorNick Khyl <nickk@tailscale.com>2025-05-09 23:12:00 -0500
committerNick Khyl <1761190+nickkhyl@users.noreply.github.com>2025-05-10 10:44:11 -0500
commitb70c0c50fd73f134b8618792d89018cb444d8987 (patch)
tree496b33588996acfbfa2c3859b575ef5bc5d28b0f /control/controlhttp/controlhttpserver/controlhttpserver.go
parent565ebbdeb8c1140fb17a21f521d45f7fbd97fdd8 (diff)
downloadtailscale-b70c0c50fd73f134b8618792d89018cb444d8987.tar.xz
tailscale-b70c0c50fd73f134b8618792d89018cb444d8987.zip
ssh/tailssh: fix data race during execution of test
In tailssh.go:1284, (*sshSession).startNewRecording starts a fire-and-forget goroutine that can outlive the test that triggered its creation. Among other things, it uses ss.logf, and may call it after the test has already returned. Since we typically use (*testing.T).Logf as the logger, this results in a data race and causes flaky tests. Ideally, we should fix the root cause and/or use a goroutines.Tracker to wait for the goroutine to complete. But with the release approaching, it's too risky to make such changes now. As a workaround, we update the tests to use tstest.WhileTestRunningLogger, which logs to t.Logf while the test is running and disables logging once the test finishes, avoiding the race. While there, we also fix TestSSHAuthFlow not to use log.Printf. Updates #15568 Updates #7707 (probably related) Signed-off-by: Nick Khyl <nickk@tailscale.com>
Diffstat (limited to 'control/controlhttp/controlhttpserver/controlhttpserver.go')
0 files changed, 0 insertions, 0 deletions