File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ func TestWorkspaceResources(t *testing.T) {
17
17
t .Run ("SingleAgentSSH" , func (t * testing.T ) {
18
18
t .Parallel ()
19
19
ptty := ptytest .New (t )
20
+ done := make (chan struct {})
20
21
go func () {
21
22
err := cliui .WorkspaceResources (ptty .Output (), []codersdk.WorkspaceResource {{
22
23
Type : "google_compute_instance" ,
@@ -32,14 +33,17 @@ func TestWorkspaceResources(t *testing.T) {
32
33
WorkspaceName : "example" ,
33
34
})
34
35
require .NoError (t , err )
36
+ close (done )
35
37
}()
36
38
ptty .ExpectMatch ("coder ssh example" )
39
+ <- done
37
40
})
38
41
39
42
t .Run ("MultipleStates" , func (t * testing.T ) {
40
43
t .Parallel ()
41
44
ptty := ptytest .New (t )
42
45
disconnected := database .Now ().Add (- 4 * time .Second )
46
+ done := make (chan struct {})
43
47
go func () {
44
48
err := cliui .WorkspaceResources (ptty .Output (), []codersdk.WorkspaceResource {{
45
49
Transition : database .WorkspaceTransitionStart ,
@@ -82,9 +86,11 @@ func TestWorkspaceResources(t *testing.T) {
82
86
HideAccess : false ,
83
87
})
84
88
require .NoError (t , err )
89
+ close (done )
85
90
}()
86
91
ptty .ExpectMatch ("google_compute_disk.root" )
87
92
ptty .ExpectMatch ("google_compute_instance.dev" )
88
93
ptty .ExpectMatch ("coder ssh dev.postgres" )
94
+ <- done
89
95
})
90
96
}
You can’t perform that action at this time.
0 commit comments