Skip to content

Commit

Permalink
Fix data race in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonAM committed Jun 1, 2023
1 parent 92ca491 commit bca65b0
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions tool/tsh/tsh_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1856,7 +1856,7 @@ func TestAccessRequestOnLeaf(t *testing.T) {
"--proxy", rootProxyAddr.String(),
"leafcluster",
}, setHomePath(tmpHomePath))
require.Error(t, err)
require.NoError(t, err)

err = Run(ctx, []string{
"login",
Expand Down Expand Up @@ -2067,7 +2067,7 @@ iUK/veLmZ6XoouiWLCdU1VJz/1Fcwe/IEamg6ETfofvsqOCgcNYJ

errChan := make(chan error)
runCreds := func() {
err = Run(ctx, []string{
credErr := Run(context.Background(), []string{
"kube",
"credentials",
"--insecure",
Expand All @@ -2079,7 +2079,7 @@ iUK/veLmZ6XoouiWLCdU1VJz/1Fcwe/IEamg6ETfofvsqOCgcNYJ
cf.mockSSOLogin = ssoFunc
return nil
})
errChan <- err
errChan <- credErr
}

// Run kube credentials calls in parallel, only one should actually call SSO login
Expand Down Expand Up @@ -2205,7 +2205,6 @@ func TestSSHHeadless(t *testing.T) {
cf.mockHeadlessLogin = mockHeadlessLogin(t, rootAuth.GetAuthServer(), alice)
return nil
}))

require.Error(t, err)
require.ErrorIs(t, err, trace.BadParameter("user must be set explicitly for headless login with the --user flag or $TELEPORT_USER env variable"))
}
Expand Down

0 comments on commit bca65b0

Please sign in to comment.