You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tailscale/ssh/tailssh
Nick Khyl b70c0c50fd 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>
7 months ago
..
testcontainers ssh/tailssh: accept passwords and public keys 10 months ago
accept_env.go ssh: Add logic to set accepted environment variables in SSH session (#13559) 1 year ago
accept_env_test.go ssh: Add logic to set accepted environment variables in SSH session (#13559) 1 year ago
incubator.go ssh/tailssh: chdir to user's homedir when directly running a command (#15351) 7 months ago
incubator_linux.go ssh/tailssh: fall back to using su when no TTY available on Linux 2 years ago
incubator_plan9.go ssh/tailssh: add Plan 9 support for Tailscale SSH 8 months ago
privs_test.go ssh/tailssh: only chdir incubator process to user's homedir when necessary and possible 1 year ago
tailssh.go ssh/tailssh: add Plan 9 support for Tailscale SSH 8 months ago
tailssh_integration_test.go ssh/tailssh: accept passwords and public keys 10 months ago
tailssh_test.go ssh/tailssh: fix data race during execution of test 7 months ago
user.go ssh/tailssh: add Plan 9 support for Tailscale SSH 8 months ago