File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -133,14 +133,16 @@ func TestAgent_GitSSH(t *testing.T) {
133133
134134func TestAgent_SessionTTYShell (t * testing.T ) {
135135 t .Parallel ()
136+ ctx , cancel := context .WithTimeout (context .Background (), testutil .WaitLong )
137+ t .Cleanup (cancel )
136138 if runtime .GOOS == "windows" {
137139 // This might be our implementation, or ConPTY itself.
138140 // It's difficult to find extensive tests for it, so
139141 // it seems like it could be either.
140142 t .Skip ("ConPTY appears to be inconsistent on Windows." )
141143 }
142144 session := setupSSHSession (t , codersdk.WorkspaceAgentMetadata {})
143- command := "bash "
145+ command := "sh "
144146 if runtime .GOOS == "windows" {
145147 command = "cmd.exe"
146148 }
@@ -152,11 +154,7 @@ func TestAgent_SessionTTYShell(t *testing.T) {
152154 session .Stdin = ptty .Input ()
153155 err = session .Start (command )
154156 require .NoError (t , err )
155- caret := "$"
156- if runtime .GOOS == "windows" {
157- caret = ">"
158- }
159- ptty .ExpectMatch (caret )
157+ _ = ptty .Peek (ctx , 1 ) // wait for the prompt
160158 ptty .WriteLine ("echo test" )
161159 ptty .ExpectMatch ("test" )
162160 ptty .WriteLine ("exit" )
You can’t perform that action at this time.
0 commit comments