@@ -59,6 +59,7 @@ func setupWorkspaceForSSH(t *testing.T) (*codersdk.Client, codersdk.Workspace, s
59
59
coderdtest .AwaitTemplateVersionJob (t , client , version .ID )
60
60
template := coderdtest .CreateTemplate (t , client , user .OrganizationID , version .ID )
61
61
workspace := coderdtest .CreateWorkspace (t , client , user .OrganizationID , template .ID )
62
+ coderdtest .AwaitWorkspaceBuildJob (t , client , workspace .LatestBuild .ID )
62
63
63
64
return client , workspace , agentToken
64
65
}
@@ -68,7 +69,6 @@ func TestSSH(t *testing.T) {
68
69
t .Run ("ImmediateExit" , func (t * testing.T ) {
69
70
t .Parallel ()
70
71
client , workspace , agentToken := setupWorkspaceForSSH (t )
71
- coderdtest .AwaitWorkspaceBuildJob (t , client , workspace .LatestBuild .ID )
72
72
cmd , root := clitest .New (t , "ssh" , workspace .Name )
73
73
clitest .SetupConfig (t , client , root )
74
74
pty := ptytest .New (t )
@@ -96,11 +96,9 @@ func TestSSH(t *testing.T) {
96
96
t .Run ("Stdio" , func (t * testing.T ) {
97
97
t .Parallel ()
98
98
client , workspace , agentToken := setupWorkspaceForSSH (t )
99
-
100
99
_ , _ = tGoContext (t , func (ctx context.Context ) {
101
100
// Run this async so the SSH command has to wait for
102
101
// the build and agent to connect!
103
- coderdtest .AwaitWorkspaceBuildJob (t , client , workspace .LatestBuild .ID )
104
102
agentClient := codersdk .New (client .URL )
105
103
agentClient .SessionToken = agentToken
106
104
agentCloser := agent .New (agentClient .ListenWorkspaceAgent , & agent.Options {
@@ -154,11 +152,9 @@ func TestSSH(t *testing.T) {
154
152
t .Parallel ()
155
153
156
154
client , workspace , agentToken := setupWorkspaceForSSH (t )
157
-
158
155
_ , _ = tGoContext (t , func (ctx context.Context ) {
159
156
// Run this async so the SSH command has to wait for
160
157
// the build and agent to connect!
161
- coderdtest .AwaitWorkspaceBuildJob (t , client , workspace .LatestBuild .ID )
162
158
agentClient := codersdk .New (client .URL )
163
159
agentClient .SessionToken = agentToken
164
160
agentCloser := agent .New (agentClient .ListenWorkspaceAgent , & agent.Options {
0 commit comments