@@ -65,16 +65,18 @@ func TestWorkspaceAgent(t *testing.T) {
65
65
})
66
66
template := coderdtest .CreateTemplate (t , client , user .OrganizationID , version .ID )
67
67
coderdtest .AwaitTemplateVersionJobCompleted (t , client , version .ID )
68
- workspace := coderdtest .CreateWorkspace (t , client , user .OrganizationID , template .ID )
69
- coderdtest .AwaitWorkspaceBuildJobCompleted (t , client , workspace .LatestBuild .ID )
68
+
69
+ anotherClient , _ := coderdtest .CreateAnotherUser (t , client , user .OrganizationID )
70
+ workspace := coderdtest .CreateWorkspace (t , anotherClient , user .OrganizationID , template .ID )
71
+ coderdtest .AwaitWorkspaceBuildJobCompleted (t , anotherClient , workspace .LatestBuild .ID )
70
72
71
73
ctx , cancel := context .WithTimeout (context .Background (), testutil .WaitLong )
72
74
defer cancel ()
73
75
74
- workspace , err := client .Workspace (ctx , workspace .ID )
76
+ workspace , err := anotherClient .Workspace (ctx , workspace .ID )
75
77
require .NoError (t , err )
76
78
require .Equal (t , tmpDir , workspace .LatestBuild .Resources [0 ].Agents [0 ].Directory )
77
- _ , err = client .WorkspaceAgent (ctx , workspace .LatestBuild .Resources [0 ].Agents [0 ].ID )
79
+ _ , err = anotherClient .WorkspaceAgent (ctx , workspace .LatestBuild .Resources [0 ].Agents [0 ].ID )
78
80
require .NoError (t , err )
79
81
require .True (t , workspace .LatestBuild .Resources [0 ].Agents [0 ].Health .Healthy )
80
82
})
0 commit comments