File tree 1 file changed +4
-6
lines changed
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) {
133
133
134
134
func TestAgent_SessionTTYShell (t * testing.T ) {
135
135
t .Parallel ()
136
+ ctx , cancel := context .WithTimeout (context .Background (), testutil .WaitLong )
137
+ t .Cleanup (cancel )
136
138
if runtime .GOOS == "windows" {
137
139
// This might be our implementation, or ConPTY itself.
138
140
// It's difficult to find extensive tests for it, so
139
141
// it seems like it could be either.
140
142
t .Skip ("ConPTY appears to be inconsistent on Windows." )
141
143
}
142
144
session := setupSSHSession (t , codersdk.WorkspaceAgentMetadata {})
143
- command := "bash "
145
+ command := "sh "
144
146
if runtime .GOOS == "windows" {
145
147
command = "cmd.exe"
146
148
}
@@ -152,11 +154,7 @@ func TestAgent_SessionTTYShell(t *testing.T) {
152
154
session .Stdin = ptty .Input ()
153
155
err = session .Start (command )
154
156
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
160
158
ptty .WriteLine ("echo test" )
161
159
ptty .ExpectMatch ("test" )
162
160
ptty .WriteLine ("exit" )
You can’t perform that action at this time.
0 commit comments