Skip to content

fix: stop waiting for Agent in a goroutine in ssh test #12268

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions cli/ssh_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -455,12 +455,9 @@ func TestSSH(t *testing.T) {
assert.NoError(t, err)
})

tGo(t, func() {
// When the agent connects, the workspace was started, and we should
// have access to the shell.
_ = agenttest.New(t, client.URL, authToken)
coderdtest.NewWorkspaceAgentWaiter(t, client, workspace.ID).Wait()
})
// When the agent connects, the workspace was started, and we should
// have access to the shell.
_ = agenttest.New(t, client.URL, authToken)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could consider a defer a.Close() here too, to speed up the agents tear-down, not sure whether or not it would help with the issue being fixed here though.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it will amount to the same thing. There is already a t.Cleanup() that closes it, which will run after the later defers in this function.


conn, channels, requests, err := ssh.NewClientConn(&stdioConn{
Reader: proxyCommandStdoutR,
Expand Down